Trying to apply rewriterule on pages.php via htaccess but not able to exclude index.php. How can I do this?
RewriteRule ^index.php$ - [L]
RewriteRule ^([-a-zA-Z]*)$ pages.php?state=$1 [L]
Through the RewriteRule applied on pages.php via htaccess, the pages are opening fine that are stored in database in the following manner:-
domain.com/delhi
domain.com/gujarat
domain.com/jammu-and-kashmir
and so on. The problem I'm facing here is that when I'm trying to access my root site, i.e. index.php as domain.com, it is returning 404. When I try to access the index.php as domain.com/index.php, it works fine. I tried couple of ways to exclude my index file from the applied rule on pages.php but no gain. Could someone help me how to actually exclude index.php from the rule applied on pages.php to make it open on the root of the domain please?