Using regex: Apache mod_rewrite ending periods on newest questions tagged regex – Stack Overflow
I am trying to better understand Apache’s mod_rewrite, and am having unexpected results. I’ve tried many different expressions, but nothing seems to behave how I understand it should.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?route=$1 [QSA,L]
Using www.domain.com/item1/item2/item3 yields item1/item2/item3
Using www.domain.com/item1/item2/item3.php yields item1/item2/item3.php
Using www.domain.com/item1/item2/item3........... yields item1/item2/item3
Why is it not item1/item2/item3...........?
Strangely, if the URL is www.domain.com/item1/item2/item3..........a, the route is what I expect, item1/item2/item3..........a
I’ve tried a few other regular expressions, but they act similarly.
Thank you.
source: http://stackoverflow.com/questions/11144079/apache-mod-rewrite-ending-periods
Using regex: using-regex
Recent Comments