Page 1 of 1

Remove www from domain

Posted: Wed Jul 16, 2008 10:16 pm
by OldDragon
Hi @all

does anybody know if it is possible (and how) to remove the www from the url? so http://www.website.com/.../ is redirected to http://website.com/.../ ?

For the rest of my website I managed to do this with mod-rewrite, but somehow serendipity ignores that. And I am not sure if touching serendipity's htaccess is the best solution.

Any ideas?

www or not www

Posted: Thu Jul 17, 2008 3:49 am
by johncanary
Try this!
  • Admin / Configuration / Path /URL to blog
    Type the complete URL to your blog homepage without the "www.". E.g.

    Code: Select all

    http://example.com/
    http://example.com/blog/
  • And set Autodetect used HTTP-host to no
Done.

Posted: Thu Jul 17, 2008 11:22 am
by OldDragon
That's what I did first, but URLs with www won't change.

Posted: Thu Jul 17, 2008 11:26 am
by garvinhicking
Hi!

John's tipp will only make the "no-www" address work, but not redirect "www" to "no-www".

To do that, you need to add a custom .htaccess rule, so you must insert the rule you use for the rest of your website into s9y's .htaccess (best before the #BEGIN S9Y statement)

REgards,
Garvin

Posted: Thu Jul 17, 2008 11:50 am
by OldDragon
The Domain is olddragon.de and the blog is at olddragon.de/weblog/.

So I tried
RewriteEngine On
RewriteBase /weblog/
RewriteCond %{HTTP_HOST} ^www\.olddragon\.de/weblog$ [NC]
RewriteRule ^(.*) http://olddragon.de/weblog/$1 [L,R=301]
But that does not work.

Posted: Thu Jul 17, 2008 12:55 pm
by garvinhicking
Hi!

Conversation continued in german thread. Please do not cross-post.

Regards,
Garvin