Ignore Slash does not appear to work with Apache htaccess
-
Recently we noticed a website using Redirection started showing 404 errors for links which worked previously. All these redirects were created WITHOUT a trailing slash, eg.:
https://example.com/some-redirect
is set up to redirect a user to https://example.com/target/ with ‘Ignore Case’ and ‘Ignore Slash’ both set:
If I use https://example.com/some-redirect in a browser (without the trailing slash) the redirect works. However, if I go to:
https://example.com/some-redirect/
the redirect fails with a 404 error.
Looking at the rewrite rules, the rule doesn’t seem to change at all if we set the ‘Ignore Slash’ setting on the redirect. In both cases, the RewriteRule is set as follows:
RewriteRule ^some-redirect$ https://example.com/target/ [R=301,L,NC]
That trailing ‘$’ should be replaced by ‘/?$’ to catch the trailing slash case but I don’t see it being added in.
- The topic ‘Ignore Slash does not appear to work with Apache htaccess’ is closed to new replies.