I'm using .htaccess for the first time and I'm encountering a loop problem. I'm trying to achieve the following:
http://something.comrewrites tohttp://something.com/mainhttp://something.com/anythingrewrites tohttp://something.com/index.php?page=anything
So far my current attempt looks like this, which works satisfactorily:
RewriteEngine on RewriteBase / RewriteRule ^/?$ /main [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /index.php?page=$1 [NC,L] However, I would like to remove both rewrite conditions to also allow requests to http://something.com/index.php to become http://something.com/index.php?page=index.php. Removing the two RewriteCond lines results in a loop and the rewrite doesn't work.
What am I doing wrong and how can I fix the problem? Thanks!