Clean URLS with mod rewrite and URL Encoded characters causes 404?
- by Richard JP Le Guen
I have a web site using mod_rewrite to get some clean urls and custom 404 pages. My .htaccess file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?clean_url=$1 [QSA,L]
</IfModule>
What puzzles me is that if the URL contains a %2F (url-encoded /) the server seems to force a 404. As an example, http://example.com/category/article would be a normal article, but then http://example.com/category%2farticle gives a server-generated 404 page. (not the custom 404 page)
I wouldn't have expected this... why this is happening? Is there a way around it?