Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

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.

share|improve this answer
    
cant it be done by htaccess? –  user43937 May 23 '10 at 23:06
    
@basit - up to my knowledge: no. –  pQd May 24 '10 at 16:16
add comment

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]
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.