Adding
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /film\.php\?url=(.*)\ HTTP
RewriteRule ^ /%2.html? [R=301,L]
to your htaccess will solve that.
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /film\.php\?url=(.*)\ HTTP
RewriteRule ^ /%2.html? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)\.html$ /film.php?url=$1 [L,QSA]
What will happen is
- if
efilmsworld.com/film.php?url=blended-film-2014
is entered then the url will get rewritten toefilmsworld.com/blended-film-2014.html
and then silently rewritten (i.e. the url in address bar doesn't change) back toefilmsworld.com/film.php?url=blended-film-2014
so the content is still shown. - if
efilmsworld.com/blended-film-2014.html
is entered, it is silently rewritten toefilmsworld.com/film.php?url=blended-film-2014
(this you were doing already. - the
[R=301]
flag tells browsers (and search engines) that the url has changed and can now be found atsometitle.html
. That page is now only shown once, so no more duplicate content.
EDIT: As per comment request.
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /video\.php\?url=(.*)\ HTTP
RewriteRule ^ /video/%2.html? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^video/([^/]*)\.html$ /video.php?url=$1 [L,QSA]