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

Is my Apache local install wrong or is yours wrong ? #89

Open
dogeatdog opened this issue May 25, 2023 · 0 comments
Open

Is my Apache local install wrong or is yours wrong ? #89

dogeatdog opened this issue May 25, 2023 · 0 comments

Comments

@dogeatdog
Copy link

dogeatdog commented May 25, 2023

Describe the bug
The first slash behaviour is different on my local Linux machine with a local Apache install.

For confidentially purposes I've made up a similar request which you can test using the link at the bottom, but it boils down to the fact that this rule :

RewriteCond %{HTTP_HOST} ^(www\.)?blabla\.com$ [NC]
RewriteRule ^(.*)/hello/([^/]+)/city\.([^/]+)$ /greetings/$2/hometown.$3 [R=301,L]

Doesn't trigger on https://www.blabla.com/hello/dennis/city.terneuzen

While this rule does :

RewriteCond %{HTTP_HOST} ^(www\.)?blabla\.com$ [NC]
RewriteRule ^(.*)hello/([^/]+)/city\.([^/]+)$ /greetings/$2/hometown.$3 [R=301,L]

A coworker told me this is due to the fact that the first slash is implicit in a RewriteRule.

However.. when I run it locally like so the initial slash is not a problem :

image

Even so, when I remove the / in my conf file, it becomes too lenient and even something like https://www.blabla.com/justsayhello/mike/city.chicago is accepted, which of course should not be the case :

image

Version of local Apache :

image

Expected behavior
I expect a local install of apache2 to act the same as this htaccess.madewithlove.com.

Reproduce link
https://htaccess.madewithlove.com?share=f23bf153-4c15-422e-b9d2-92c680ffb21b

second link where I changed the rule by remove the first slash : https://htaccess.madewithlove.com?share=5ab39841-432c-4eb3-a430-200aab12b283 Note that you can just use anything that ends in "hello" for the first part...

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