Remove www from domain

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Locked
OldDragon
Regular
Posts: 6
Joined: Wed Jul 16, 2008 8:57 pm
Location: Berlin, Germany
Contact:

Remove www from domain

Post 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?
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

www or not www

Post 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.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14
OldDragon
Regular
Posts: 6
Joined: Wed Jul 16, 2008 8:57 pm
Location: Berlin, Germany
Contact:

Post by OldDragon »

That's what I did first, but URLs with www won't change.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
OldDragon
Regular
Posts: 6
Joined: Wed Jul 16, 2008 8:57 pm
Location: Berlin, Germany
Contact:

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Locked