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 am setting up an apache2, and I am wondering how I would do this :

I want to redirect www.example.org/destination to a certain folder on my server, let's say /home/sites/mydestinationdirectory .

However I do not want to make the actual folder "destination" in /var/Www.

Is this possible in Apache2 and how would I do this ?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use Apache's Alias directive.

Alias /destination /home/sites/mydestinationdirectory

<Directory /home/sites/mydestinationdirectory>
  Order allow,deny
  Allow from all
</Directory> 

Another way would be to use mod_rewrite for more complex setups.

share|improve this answer
    
The Alias and alias target should always both have a slash or both not have a slash at the end. Do not mix those! –  adaptr Nov 1 '11 at 14:22
    
And use AliasMatch or Redirectmatch for more complex cases. Most people who use mod_rewrite should really not be using mod_rewrite. –  adaptr Nov 1 '11 at 14:23

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.