1
example.com/watch.php?id=1995/english-videos <- this url i want to redirect like this -> www.example.com/watch/1995/english-videos

i want to redirect only watch.php and i want to get value after id=

at present my htaccess file /.htaccess

RewriteEngine on

RewriteCond %{HTTP_HOST} ^col3negmovie.com$
RewriteRule ^(.*)$ "http\:\/\/www\.col3negmovie\.com\/$1" [R=301,L]

if can someone help me for do this one... thanks. and i want to 301 Redirect

example.com/watch.php?id=1995/english-videos <- want to get this value and redirect to this url www.example.com/watch/1995/english-videos like this..

anubhava
  • 761,203
  • 64
  • 569
  • 643
user3501407
  • 447
  • 6
  • 21

1 Answers1

1

You can use:

Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^col3negmovie\.com$
RewriteRule ^(.*)$ http://www.col3negmovie.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+watch\.php\?id=([^\s&]+) [NC]
RewriteRule ^ watch/%1? [R=301,L]

RewriteRule ^watch/(.+?)/?$ watch.php?id=$1 [L,QSA,NC]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • @anubhava Pardon I have a `awk` [question](http://stackoverflow.com/questions/23039264/working-with-arrays-in-bash-and-do-stuff)... – MLSC Apr 13 '14 at 05:13