Solved

Howto redirect to another folder in Apache

Posted on 2008-10-27
2
720 Views
Last Modified: 2012-05-05
Hello,

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

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

When I go to min.doman.nu I want apache to look up http://min.doman.nu/ and redirect me to another folder that is called test.

I thought that it was like this:

<VirtualHost 80.55.122.22>
ServerName min.doman.nu
ServerAlias min.doman.nu/test/
Redirect permanent / http://min.doman.nu/test
</VirtualHost>

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?

Thanks
0
Comment
Question by:tommyrihu
2 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 50 total points
Comment Utility
You need a virtualhost for both domains
NameVirtualHost *:80

<VirtualHost *:80>

ServerName doman.nu

ServerAlias www.doman.nu

DocumentRoot /physical/path/to/doc/root

</VirtualHost>
 

<VirtualHost *:80>

ServerName min.doman.nu

RedirectMatch permanent ^/$ http://min.doman.nu/test/

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

</VirtualHost>

Open in new window

0
 

Author Closing Comment

by:tommyrihu
Comment Utility
Thank you very much for your good explanation.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

771 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

10 Experts available now in Live!

Get 1:1 Help Now