You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to convert a site I inherited's URLs to lose their .php extension using your image. Two variations of rules I have tried result in 404s in the container, but work on the shared production host and on an online htaccess tester. The rules are:
RewriteRule ^([0-9a-z-]+)$ $1.php [NC]
and
RewriteRule ^([^\ \.]+)$ $1.php [NC]
(I know, they are not quite the same matches, but either will get the job done in this case :) )
Another rewrite rule to change legacy index files does work: RewriteRule ^index.(html|php)$ / [R=301]
Docker is my local dev environment. The annoyance with this not working is that my menu links won't work locally.
Also, I tried setting a RewriteLog directive to diagnose the problem, which resulted in a 500 error with Apache's error log saying: "Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration".
Do you have any idea why these patterns might be failing in your image's containers?
Edit: for example, /about-us should rewrite /about-us.php. Even when I test ^about-us$, it doesn't match.
The text was updated successfully, but these errors were encountered:
hughbris
changed the title
At least some RewriteRule patterms are not matching
At least some RewriteRule patterns are not matching
Sep 23, 2020
I've been trying to convert a site I inherited's URLs to lose their
.php
extension using your image. Two variations of rules I have tried result in 404s in the container, but work on the shared production host and on an online htaccess tester. The rules are:RewriteRule ^([0-9a-z-]+)$ $1.php [NC]
and
RewriteRule ^([^\ \.]+)$ $1.php [NC]
(I know, they are not quite the same matches, but either will get the job done in this case :) )
Another rewrite rule to change legacy index files does work:
RewriteRule ^index.(html|php)$ / [R=301]
Docker is my local dev environment. The annoyance with this not working is that my menu links won't work locally.
Also, I tried setting a
RewriteLog
directive to diagnose the problem, which resulted in a 500 error with Apache's error log saying: "Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration".Do you have any idea why these patterns might be failing in your image's containers?
Edit: for example,
/about-us
should rewrite/about-us.php
. Even when I test^about-us$
, it doesn't match.The text was updated successfully, but these errors were encountered: