.htaccess - Setting up htaccess file for sub-folder redirection -
i have question regarding htaccess redirecting.
i have domain called www.test.com , there many subfolders in that, www.test.com/admin/ , www.test.com/users/ etc. want redirect different urls based on each url, i.e,
www.test.com should redirect www.abc.com www.test.com/admin/ should redirect www.xyz.com www.test.com/users/ should redirect www.pqr.com
how can write htaccess file redirect different urls based on each request (something checking condition in incoming url)?
you want like:
rewriteengine on rewriterule ^users/(.*)$ http://www.pqr.com/$1 [l,nc,qsa,r=301] rewriterule ^admin/(.*)$ http://www.xyz.com/$1 [l,nc,qsa,r=301] # ... add more rules needed rewriterule ^(.*)$ http://www.abc.com/$1 [l,nc,qsa,r=301]
Comments
Post a Comment