Help - Search - Members - Calendar
Full Version: quick apache question...
The Planet Forums > System Administration > General Support Questions
Snarf
Hey folks, I understand the basics but am stumped on how to do this in httpd.conf:

I have www.blah.com

And I want to set up "test.blah.com" such tha all requests for URL http://test.blah.com are forwarded to http://blah.com/test.html.

Any hints as to how I can config this?

Thanks
adrianwalters
The quick and dirty solution to this would be to just have a redirect page that bounces the user from http://test.blah.com/ to http://blah.com/test.html. You could do that in one of many ways - PHP, META Tag, Javascript, etc...

The elegant way and probably more preferred method would be to use mod_rewrite to transparently redirect the user. In your vhost block for that vhost you should have something that looks similar to this....



ServerName test.blah.com
RewriteEngine On
RewriteRule ^(.*)$ http://blah.com/test.html [R,L]


This will send any request for that VirtualHost to http://blah.com/test.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.