This is a discussion on Re: Redirect website without losing URL? within the Apache Web Server forums, part of the Web Server and Related Forums category; Ignoramus31542 wrote: > I have a website with two addresses: > > http://www.algebra.com > http://algebra.com &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Ignoramus31542 wrote:
> I have a website with two addresses: > > http://www.algebra.com > http://algebra.com > > both are the same website hosted on the same machine. > > What I would like is to set up redirection, so that when a user visits > a url like this: > > http://algebra.com/dir/file.html > > he is redirected automatically to > > http://www.algebra.com/dir/file.html > > I run Apache 2.0.54. How can this be done? > > thanksd > > i > in your httpd.conf use the following in your VirtualHost tag for the domain. <VirtualHost xxx.xxx.xxx.xxx:80> ServerName algebra.com ServerAlias www.algebra.com DocumentRoot /path/to/document/root </VirtualHost> Don't forget that you also need DNS setup |