Q:

Rewrite .htaccess

I want to change
/index.php?do=/pages/
to
/index.html?do=/pages/
my code not working
      RewriteCond %{THE_REQUEST} ^[A-Z]+\s([^\s]+)\.php?do=\s
      RewriteRule .* %1.html [R=301,L]
      RewriteRule ^(.*)\.html$ $1.php

A:

You can do something like this :
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/([A-Za-z0-9_-.]*).php?do=(.*)
    RewriteRule .* /%1.html?do=%2 [R=301,L]
</IfModule>

This should match
everything.php?do=anything

to rewrite it to 
everything.html?do=anything

