Solved

Howto redirect to another folder in Apache

Posted on 2008-10-27
2
726 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
ID: 22815590
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
ID: 31510454
Thank you very much for your good explanation.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Mint 18 31 89
wamp versus xampp 4 58
How yum repo uses sqlite3 to keep metadata about the repository? 2 33
awk variable in printf 1 23
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…

785 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