I have added a .htaccess file to my root folder, and i wanted everything written after the / to be sent to the index.php file as get data.
My root path looks like this http://www.site.com/folder/ and my .htaccess is located in the folder directory together with index.php
This is my .htaccess file:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) index.php?args=$1
Now, what ever i write behind folder/ in my url, args is “index.php”. So when i visit http://www.site.com/folder/lots/of/bogey the args variable is “index.php”
My goal is obviously to have the args variable be “lots/of/bogey”. Any ideas what I’m doing wrong?
I think that’s because after executing the RewriteRule and getting
index.php?args=...theRewriteRulegets called again. Nowindex.phpis your filename, so it get’s passed as args. After this mod_rewrite aborts due to recursion. To fix this, add aRewriteCondwhich enures the file isn’tindex.php.