Helpful Information
 
 
Category: Apache Development
Redirecting?

I want to find a way to redirect a browser to a different virtual host on the same server, I want the URL in the browser to update, not just have apache pull it from somewhere else on the harddrive.

Example, I want to redirect http://somesite.com to http://www.somesite.com

and I want apache to tell the browser to look to that other virtual host.

Can anyone help me?

>>not just have apache pull it from somewhere else on the harddrive

That's internal redirect.

>>I want to redirect http://somesite.com to http://www.somesite.com

That's external redirect.

You can try mod_rewrite -> http://httpd.apache.org/docs/misc/rewriteguide.html and look for external one. And of course, you need to have VirtualHost block for each of those (somesite.com and http://www.somesite.com)

Not using ServerAlias somesite.com http://www.somesite.com in one go.










privacy (GDPR)