• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 737
  • Last Modified:

Howto redirect to another folder in Apache

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
tommyrihu
Asked:
tommyrihu
1 Solution
 
caterham_wwwCommented:
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
 
tommyrihuAuthor Commented:
Thank you very much for your good explanation.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now