[Mediawiki-l] Short URL reflecting wiki structure, no www

George Herbert george.herbert at gmail.com
Wed Aug 8 21:00:00 UTC 2007

On 8/8/07, Sean O'Connor <sean at transabled.org> wrote:
> > >   I think have managed to stop jumping from www to no-www
> > > between loging in by using $wgServer = "http://mydomain.com"; in my
> > > localsettings.php page, but someone can still load a page by typing
> > > the www in the address bar.  Any thoughts on this one?
> >
> > That seems fine to me.
> Yes, it's fine, but it doesn't stop people from typing the www in
> their address bar and loading the site that way.  I don't want that to
> happen.
> However, someone else suggested a bit of .htaccess that should work.
> BTW, thanks for the suggestion to Google it.  I tend to do that
> anyway, but I guess I missed that.

Do you want "www.domain.com" to NOT work, or to redirect so that it
ends up being "domain.com" if they try it?

You can do the redirect with a DNS setup called a "CNAME".  You point
the name "www.domain.com" to the canonical name "domain.com".  Anyone
who does a name lookup in DNS for "www.domain.com" gets the response
back "www.domain.com is domain.com" and will proceed appropriately.

If you don't want to return any values if someone connects to
www.domain.com then that's a simple matter of not having a DNS entry
for www.domain.com at all.  No entry, no lookup works for it, and they
won't get to domain.com if they try.

-george william herbert
george.herbert at gmail.com

More information about the MediaWiki-l mailing list