0

I have a site like twitter.com on server one and on server two I have a forum, which path is like domain.com/forum.

On server one I wanted to implement wild card DNS for the domain but on server two I wanted to keep the forum separate. I can't give the sub-domain forum.domain.com because all its links are already in search engines and link back to domain.com/forum.

So, I was wondering, how can I put the domain and wild card DNS on server one and still be able to give the path on server 2 for domain.com/forum (as a sub-folder).

Any ideas?

Do you think htaccess can do that job? If yes, then how?

3 Answers 3

1

wildcard dns is not the best idea. anyway - on server one you can set up reverse proxy - using apache, nginx or something else. you can route some of requests [ based on url ] to local application server and some of them to remote machine.

2
  • cant it be done by htaccess?
    – user43937
    May 23, 2010 at 23:06
  • @basit - up to my knowledge: no.
    – pQd
    May 24, 2010 at 16:16
1

Your question is not very clear. You never explained why you need wildcard domains working.

If you want to set up forum.domain.com or forum.twitter.com, not sure what your goal is, but if that's the case and you're worried about links in search engines, then why don't you just use 301 redirects in htaccess? (first test as 302 redirects before committing to 301s).

First test with:

RewriteRule ^/forum/(.*) http://forum.domain.com/$1 [R=302,L]

If that works, then move your forum to the root of the site at forum.domain.com and change the rewrite to:

RewriteRule ^/forum/(.*) http://forum.domain.com/$1 [R=301,L]
0

It should be possible to do with redirect, add this line to VirtualHost specification:

 Redirect /forum http://forum.domain.com/forum

Alternatively, do a reverse proxy: in conf.d add file forum with contents similar to this:

 ProxyPass /forum http://forum.domain.com/forum
 ProxyPassReverse /forum http://forum.domain.com/forum
 <Location /forum>
 </Location>

and add

 <Proxy *>
   AddDefaultCharset off
   Order deny,allow
   Allow from all
 </Proxy>

to mods-enabled/proxy.conf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .