Howto redirect to another folder in Apache

Posted on 2008-10-27
Last Modified: 2012-05-05

As an example
In the DNS record there is one domain that is called "" and points to has a standard homepage.

There is also one "" and points to the same IP this one has a different homepage and are in another folder.

When I go to I want apache to look up and redirect me to another folder that is called test.

I thought that it was like this:

Redirect permanent /

What more do i have to do? its only one homepage on that webserver

Its an old FreeBSD with apache version 1.6 or something
do i have to activate virtual host in someway?

Question by:tommyrihu
LVL 27

Accepted Solution

caterham_www earned 50 total points
ID: 22815590
You need a virtualhost for both domains
NameVirtualHost *:80

<VirtualHost *:80>



DocumentRoot /physical/path/to/doc/root


<VirtualHost *:80>


RedirectMatch permanent ^/$

DocumentRoot /physical/path/to/min/doc/root


Open in new window


Author Closing Comment

ID: 31510454
Thank you very much for your good explanation.

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now