Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At least some RewriteRule patterns are not matching #109

Open
hughbris opened this issue Sep 23, 2020 · 0 comments
Open

At least some RewriteRule patterns are not matching #109

hughbris opened this issue Sep 23, 2020 · 0 comments

Comments

@hughbris
Copy link

hughbris commented 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.

@hughbris hughbris changed the title At least some RewriteRule patterms are not matching At least some RewriteRule patterns are not matching Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant