Original url: example.com?file=gallery&d=doc
I want: example.com/gallery.html
My .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
RewriteRule ^([^/]*)\.html$ /?file=$1&d=doc [L]
(removed d=doc from url because this not needed)
Now clean URL’s work but I want 301 redirect all old URL’s (?file=example&d=doc). Anyone can help me with .htaccces? Now page is availiable from example.com?file=gallery&d=doc and example.com/gallery.html but should be ONLY from example.com/gallery.html.
Try this :