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>
3
  • Why did you add the question mark then? What happened without? And why the [NC] nocase matching? Commented Jul 25, 2015 at 18:19
  • not working without question mark also Commented Jul 25, 2015 at 18:22
  • Check the error.log against the access.log, enable the rewritelog else. Get rid of the <IfModule> crud. See also Reference: mod_rewrite, URL rewriting and "pretty links" explained Commented Jul 25, 2015 at 18:23

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.