[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache (was Apace) Redirect Question

On Friday, November 2, 2012 21:48, "Wolf Halton" <wolf.halton@gmail.com> said:

> Make these changes in sites-available files. That is what those files in
> there are for.
> I don't have the specific directive but I can put up one of my servers'
> apache files for you.
> Wolf Halton
> http://sourcefreedom.com
> Apache developer:
> wolfhalton@apache.org

Thanks Wolf, and it makes sense that the directives that apply to a site would
go in that site's definition. I just don't quite understand what I need to put
in there. When I check the default site access logs, I see the request for
http://domain1.com come in as /, but I also see the same for domain2.com and
for the IP address. All three show up as "GET / HTTP/1.1" I understand that the
server does not know about the sites by those names because I haven't 
configured it to do so.

Obviously Apache is capable of this distinction because if I change the
ServerName in domain1's sites-available to domain1.com then the index.html file
in /var/www/htdocs/domain1.com is returned to the client. If I add the 
ServerAlias www.domain1.com directive then both the request for domain1.com and 
the request for www.domain1.com return /var/www/htdocs/domain1.com/index.html,
but the URL does not change in the navigation bar, and both show up in the log 
as "GET / HTTP/1.1".

I know I've entered URL's into my browser's navigation bar and watched them
change to something else, such as entering http://example.com and being
redirected to http://www.example.com, with that URL then populating the
navigation bar. So I'm close in that both requests return the file that I
want returned, but I don't know how to have the URL change so the user sees
the URL I want them to see.

So I guess what I'm asking is, how do I configure things so that the server
knows a request for domain1.com should be handled as if it were a request for
www.domain1.com, and sends the client to that URL?


Sent - Gtek Web Mail

Reply to: