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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

688 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