php - Mod_Rewrite not rewriting URLs -
i've got following url structure:
- /page.php?file=about
- /page.php?file=contact
- etc
.htaccess file has following code:
rewriteengine on rewriterule ^([^/]*)\.html$ /page.php?file=$1 [l]
does not try rewrite urls @ all. i'm looking /about.html, /contact.html
is .htaccess code or kind of settings on server?
you can use:
rewriteengine on rewritecond %{the_request} /page\.php\?file=([^\s&]+) [nc] rewriterule ^ /%1.html? [r=302,l,ne] rewriterule ^([^/]+)\.html$ page.php?file=$1 [l,qsa,nc]
Comments
Post a Comment