I have a PHP file located in a folder (“www.mysite.com/folder/test.php”) which accepts a get argument (str) and lets say print. in order to make the URLs SEO friendly I’m trying to rewrite it like this:
RewriteBase /
RewriteRule ^folder/(.*)$ folder/test\.php?str=$1&%{QUERY_STRING}
the rewrite rule works fine, the problem is when I need to access the subfolder of that folder. for example if there is an image in test.php that is located at http://www.mysite.com/folder/images/img.jpg, according to the above rule it takes images/img.jpg and passes it to the php file.
how can prevent that?
Look at:
Should solve your problem – this just makes sure that the URL being requested is neither an actual file nor directory on the server.