.htaccess rewrite / to index.html, all other to index.php -
i want use .htaccess rewrite url webite:
if url http://mydomain.com or http://mydomain.com/ index.html serve request, other urls go index.php
please help!
quite simple, in 2 rules. 1 rule root (^$
, matches empty string after leading request_uri
slash), , rest other routes ((.+)
, matches 1 or more characters):
rewriterule ^$ index.html [l] rewriterule (.+) index.php [l]
note: leading slash not appear in source pattern. why first rule checks empty string.
Comments
Post a Comment