I want to redirect several domains to different sub directories. For example:
If a visitor uses the domain http://www.cookie.com which has a HTTP redirect to http://www.mainme.com then when the visitor gets there, Apache detects the domain and redirects it to mainme.com/cookie
Same for puppy.com. If it gets HTTP redirected to mainme.com, when the user gets there it gets redirected to mainme.com/puppy
Can this be done in .htaccess?
Using Linux as server with /var/www as web folder.
Not using Virtualhost right now but learning how to do it.
I don’t really know what you mean by
If it get’s forwarded with a HTTP-redirect you need to change that redirect to your needs (so attach
/cookieor/puppyat the end).If your domains are sharing the same documentroot you need to place this code in your .htacces in it:
EDIT:
So you might have the http-referer as clue where the user came from. Try this: