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

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -