Remove Trailing Slash From Root WP Directory

Question

I have WP installed in a directory above the domain ( example https://example.com/folder/ )

I want the WP index page to get accessed without the trailing slash ( example https://example.com/folder ).

WP by default is doing a 301 redirect to https://example.com/folder/

I have tried the following with no resolution:

1) Set the Permalinks setting to: /%postname% My canonical is correct and showing https://example.com/folder but it is still 301 redirecting to https://example.com/folder/

2) Edited the .htaccess file to:

RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)/$ /$1 [L,R]

3) Removed the redirect_canonical() filter from functions.php:

add_filter('template_redirect', 'redirect_canonical');
0
, Juan Cullen 3 years 2020-06-08T05:10:27-05:00 0 Answers 100 views 0

Leave an answer

Browse
Browse