Use non-www version for url on one of my domains

This is a discussion on Use non-www version for url on one of my domains within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I have problems finding information on this, so I'm asking here. With my old host, it was just ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-02-2006
shittshit
 
Posts: n/a
Default Use non-www version for url on one of my domains

Hi,

I have problems finding information on this, so I'm asking here.

With my old host, it was just a matter of clicking a button to change this.
Now I run a server on my own with debian and apache2, but don't know
where to make changes in the configuration.

I want all the urls of one of my domains to use the version without www
in front.
When a visitor goes to www.mydomain.com/subdir/somepage.html, he should
be redirected to mydomain.com/subdir/somepage.html.

Any help?
  #2 (permalink)  
Old 12-02-2006
Scott Lindner
 
Posts: n/a
Default Re: Use non-www version for url on one of my domains


"shittshit" <shit@invalid.inv> wrote in message news:ekspdc$l0$1@aioe.org...
> Hi,
>
> I have problems finding information on this, so I'm asking here.
>
> With my old host, it was just a matter of clicking a button to change
> this.
> Now I run a server on my own with debian and apache2, but don't know where
> to make changes in the configuration.
>
> I want all the urls of one of my domains to use the version without www in
> front.
> When a visitor goes to www.mydomain.com/subdir/somepage.html, he should be
> redirected to mydomain.com/subdir/somepage.html.
>
> Any help?


There's two parts to this. DNS and your Apache configuration for this host.
Have you verified that DNS is resolving properly for this?

Scott


  #3 (permalink)  
Old 12-03-2006
shimmyshack
 
Posts: n/a
Default Re: Use non-www version for url on one of my domains


Now you need to strip off the www using rewrites, this is explained in
a great tutorial
by Randall:

http://www.searstower.org/rkrause/virtualhosts.html

if you wanted them to both use the same set of files for now, you can
just do this:

ServerName www.mydomain.com
and add
ServerAlias mydomain.com

so that both servers use the same doc root. However this will only work
if you are not using mass virtual hosting, and rewrites that might
interfere, and make sure any cookie logic will still work.

  #4 (permalink)  
Old 12-03-2006
shittshit
 
Posts: n/a
Default Re: Use non-www version for url on one of my domains

shimmyshack wrote:
>
> if you wanted them to both use the same set of files for now, you can
> just do this:
>
> ServerName www.mydomain.com
> and add
> ServerAlias mydomain.com



My apache configuration is already set up exactly like you said:

ServerName www.mydomain.com
ServerAlias mydomain.com



> Now you need to strip off the www using rewrites, this is explained in
> a great tutorial
> by Randall:
>
> http://www.searstower.org/rkrause/virtualhosts.html



I'm not to good at using rewrites. I don't even know which part of that
page you gave me is relevant to my problem...
  #5 (permalink)  
Old 12-05-2006
R Krause
 
Posts: n/a
Default Re: Use non-www version for url on one of my domains

shittshit wrote:
:
> I want all the urls of one of my domains to use the version without www
> in front.
> When a visitor goes to www.mydomain.com/subdir/somepage.html, he should
> be redirected to mydomain.com/subdir/somepage.html.


Where is the zone file for your domain hosted? If it's on a registrar
such as GoDaddy or eNom, it should be easy to change the 'www'
subdomain from an A Record to a simple redirect URL (and still retain
the full path and query-string). It's a lot easier that way.

--Randall

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:20 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0