Reputation: 585
WordPress adds trailing slash to each url as per permalink settings.
/%postname%/
So if you browse www.mysite.com/about-us you will be redirected to www.mysite.com/about-us/
Is it possible to disable this redirect so that the page is served with and without the trailing slash.
Upvotes: 3
Views: 8260
Reputation: 9373
You can update your .htaccess file with following rules.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule (.+)/$ http://your_domain_name/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Upvotes: 2
Reputation: 5211
change permalink /%postname%/
to /%postname%
Right below the RewriteEngine On line, add:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]
Upvotes: 4
Reputation: 653
You can change .htaccess rules, defined by WordPress. This topic might hepls you.
Upvotes: 0