Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site like on server one and on server two I have a forum, which path is like

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 because all its links are already in search engines and link back to

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 (as a sub-folder).

Any ideas?

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

share|improve this question

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

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

If you want to set up or, 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/(.*)$1 [R=302,L]

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

RewriteRule ^/forum/(.*)$1 [R=301,L]
share|improve this answer

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

 Redirect /forum

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

 ProxyPass /forum
 ProxyPassReverse /forum
 <Location /forum>

and add

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

to mods-enabled/proxy.conf

share|improve this answer

Your Answer


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.