Forum Moderators: phranque
I have multiple domains routed to the same destination, e.g.
A-domain.com, B-domain.com and C-domain.com
-> end up on the installation Main-Domain.com
Now I need some temporary and/or permanent forwarding that routes e.g.
A-domain.com -> Main-Domain.com/A
B-domain.com -> Other-Domain.com/B
C-domain.com -> Other-Domain.com/C
I am looking for a solution where I can quickly add, change or delete the routing, kind of a bulk-rerouting.
I do not operate an own DNS.
It rather might be a solution with .htaccess, scripting or whatever ... any hints, tips & tricks?
BTW: I just found out that typo3 supports multiple domains on the same installation... how does this work and could this be adapted for my problem?
Side-question: Do search engines or browsers realize such a forwarding?
are you using apache for all those domains?
if so, you could set up external redirects using mod_rewrite.
are all the redirects one-to-one?
will they all be temporary or permanent redirects (per domain)?
fairly simple and can be done in .htaccess context...
I have them all on different shared hosting servers and all are apache (but some with slight different configurations).
Almost all redirects would be one-to-one.
It's mixed temporary and/or permanent redirects about 50:50 and I talk about over 500 domains, so I'm looking for a simple solution where I can maybe edit one file quickly instead of changing at the registrar DNS or forwarding one by one.
To be honest: I don not know much about apache configuration or php coding, but with .htaccess you mean kind of adding lines like
> Redirect permanent B-domain.com [Other-Domain.com...]
This was my Idea, but I couldn't make it working.
If so, could you give me a sample?
Redirect permanent / http://Other-Domain.com/C/
The URL-path specified on the left (for the "old" server where this code resides) must be a local URL-path only. See the mod_alias documentation [httpd.apache.org].
Mod_alias' RedirectMatch and mod_rewrite directives can be used to get more complex and/or conditional redirects.
Jim
a) Do I have to check HTTP_HOST or HTTP_REFERER?
b) What is the correct condition/rule order when having multiple domains to different other domains?
Would it be possible to provide me with a sample htaccess e.g. with this:
*.A-domain.com/* -> Main-Domain.com/this
*.B-domain.com/* -> Other-Domain.com/that
*.C-domain.com/* -> Other-Domain.com/there
We don't do that here... Please review our forum charter [webmasterworld.com]. We'll be glad to help you learn to do it yourself, or you can try searching this forum [google.com] for previous threads on this subject, of which there are many.
Jim