apache - redirect based on directory in path via .htaccess -


via .htaccess, how redirect this

http://www.somedomain.com/de/foo 

to this:

http://www.de-domain.com/foo 

the redirection should depend on second parameter, in example above "de".

depending on server configuration should able on .htaccess somedomain.com. if works appropriately might try [r=301,l] make redirection permanent:

rewriteengine on rewritecond %{http_host} ^(www\.)?somedomain.com$ rewriterule ^([a-z]{2})/(.*) http://www.$1-domain.com/$2 [r,l] 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -