How can I force WP to add a trailling sliash in htaccess?
-
I am using the Quick Redirects plugin to set up page redirects, and, while that works brilliantly, I still am having some issues with redirects. Please understand, this is an .htaccess question and not a question about the plugin.
Here is the situation. When we set up the redirects, the ones without a trailing slash do not get redirected. For example https://domain.com/something doesn’t get redirected, but https://domain.com/something/ (notice the trailing slash) does get redirected properly. Now, I have searched up and down on the interwebs, and while there is tons of info about regular expressions, mod_rewrite and .htaccess, I have yet to find anything WordPress-centric that helps me. So I am asking the community, how can I force a trailing slash on non-slash domains?
Here is the relevant portion of my .htacess file:
### Uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* #RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L] ### Add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]
Any insight into this would be greatly appreciated.
- The topic ‘How can I force WP to add a trailling sliash in htaccess?’ is closed to new replies.