Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 content on which can't reside on Nevertheless, all my other content resides in folders of the* type.

For the sake of consistency, I'd like the content actually located at to appear as if it were on — Is there any way, using .htaccess, that I can achieve this, bearing in mind that:

(1) the subdomain itself also has a nested permalink structure, meaning that there are additional folders in the directory structure of the subdomain;

(2) I want the browser to display the address as mydomain/subdomain1 after the redirect.

share|improve this question

migrated from Apr 13 '10 at 21:56

This question came from our site for professional and enthusiast programmers.

Because of the reference to .htaccess, I assumed it is Apache and I retagged accordingly. – bortzmeyer Apr 14 '10 at 9:53
The question is far too vague: is it static files on the disk or some sort of CMS and, if so, which one? – bortzmeyer Apr 14 '10 at 9:54

Not sure why this has a DNS tag. DNS will not do what you want. DNS is designed to resolve host name to an ip address (A record) and vice versa (PTR record). It can also point one hostname to another hostname, and this is called a CNAME record.

As far as redirecting to

try something like this

RewriteEngine On
RewriteCond    %{HTTP_HOST} ^subdomain1\.
RewriteRule    /(.*)$1 [R=301,L]
share|improve this answer

Your Answer


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