.htaccess - htaccess Redirection - domain.com/folder to website.com/folder -


i have thought simple question suppose i'm missing something.

i have website 2 domain names associated it. i'd modify .htaccess file trying access particular folder redirected correct domain name.

for example:

someone accessing www.domain.com/folder/ should redirected www.website.com/folder/, folder.

what have include in .htaccess file this?

any appreciated!

rewritecond trick. note: didn't test verbatim, it's psuedocodish.

rewritecond ${http_host} domain.com [or] rewritecond ${http_host} www.domain.com rewriterule ^folder/(.*)$ http://www.website.com/folder/$1 [qsa,r=301,l] 

make sure check docs @ http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html flags [qsa] means append query string.

note r=301 flag, tell visitor permanent redirect. there many other flags can use...


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -