I have to redirect url in my site to single url. Means if any go to http://www.example.com/blog/photos/IMG_5867_2-tm.jpg, He should go to the particulate url i gave. e.g. ( http://www.example.com/blog/wp-content/uploads/2015/08/common.png )
I have followed some answers in the previous question from Stackoverflow. But it is not working for me. I have tried like this.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Rewriterule ^blog/photos/(.*)$ exampe.com//blog/wp-content/uploads/2015/08/common.png$1 [r=301,nc]
RewriteRule . /blog/index.php [L]
</IfModule>
Is there anything wrong i have done. Please help and advance thanks.
You can use:
If your .htaccess is placed in
/blog/
directory thenRewriteRule
will match URI pattern after/blog/