mod rewrite - .htaccess to redirect subdomain to another domain -


i want redirect .domain.com/ .otherdomain.com/ , domain.com/* otherdomain.com/* on other server.

also, want address bar change new domain

eg: hi.domain.com/there -> hi.otherdomain.com/there

i found examples of .htaccess cannot make both rules in one.

how can that?

thanks!

you can try in .htaccess in root.

rewriteengine on rewritecond %{http_host} ^(.+\.)?domain\.com$ rewriterule ^(.*)$ http://%1otherdomain.com/$1 [r=301,l] 

Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -