0

I have URL like www.yoursite.com/watch?v=OYQ3svsQ8Ys and want to redirect it to www.yoursite.com/index.php?v=OYQ3svsQ8Ys

Actually Question mark makes problem I am trying :

 <ifModule mod_expires.c>  
    Options +FollowSymLinks -MultiViews
    RewriteEngine On

    RewriteCond %{QUERY_STRING} ^v=([^&]+) [NC]
    RewriteRule ^watch$ index.php? [NC,L,QSA]
 </ifModule>
mario
  • 138,064
  • 18
  • 223
  • 277
Pritam Narkhede
  • 113
  • 1
  • 8
  • Why did you add the question mark then? What happened without? And why the `[NC]` nocase matching? – mario Jul 25 '15 at 18:19
  • not working without question mark also – Pritam Narkhede Jul 25 '15 at 18:22
  • Check the error.log against the access.log, enable the rewritelog else. Get rid of the `` crud. See also [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/a/31280108) – mario Jul 25 '15 at 18:23

1 Answers1

1

The only error in your file is if content <ifModule mod_expires.c>. Change it to rewrite

<ifModule mod_rewrite.c>  
    Options +FollowSymLinks -MultiViews
    RewriteEngine On

    RewriteCond %{QUERY_STRING} ^v=([^&]+) [NC]
    RewriteRule ^watch$ index.php? [NC,L,QSA]
 </ifModule>
splash58
  • 25,216
  • 3
  • 19
  • 31