.htaccess redirect root directory and subpages with parameters
- by wali
I am having difficulty trying to redirect a root directory while at the same time redirect pages in a sub directory to a different URL. For example:
http://test.example.com/olddir/sub/page.php?v=one
to
http://test.example.com/new/one
while also redirecting the any request to the root of the olddir folder.
I have tried
RewriteCond %{QUERY_STRING} v=one
RewriteRule ^/olddir/sub/page.php /new/? [R=301]
and
RedirectMatch /oldir "test.example.com"
RedirectMatch /olddir/sub/page.php?v=one "test.example.com/new/one"
Any help at this point will be extremely appreciated...Thanks!