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 ?

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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