I want to use .htaccess to rewrite url to my webite:
If url is http://mydomain.com or http://mydomain.com/ the index.html will serve the request, all other urls will go to index.php
please help!
I want to use .htaccess to rewrite url to my webite:
If url is http://mydomain.com or http://mydomain.com/ the index.html will serve the request, all other urls will go to index.php
please help!
Quite simple, in two rules. One rule for the root (^$, which matches the empty string after the leading REQUEST_URI slash), and the rest for all other routes ((.+), which matches one or more characters):
RewriteRule ^$ index.html [L]
RewriteRule (.+) index.php [L]
Note: the leading slash does not appear in the source pattern. This is why the first rule checks for an empty string.