28, May 2012

leading www in url - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: leading www in url
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: leading www in url  (Read 3175 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: Jul 05, 2006, 03:52:19 pm »

Hello,

I learned that a website need to answer on both request like:
www.domain.com
or
domain.com

while checking the indexed pages in Google I noticed that there are several indexed (double) pages without the leadding www.

my question is do I need to rewrite the URL ?

If yes, is this a normal situation?

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Jul 05, 2006, 03:57:22 pm »

I allways do that (visit this site without www to see Smiley )

It worths to do permanent redirects when there are links to both urls.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 05, 2006, 03:59:40 pm »

I allways do that (visit this site without www to see Smiley )

It worths to do permanent redirects when there are links to both urls.
I makes sense, but why is this not a default configuration on all apache webservers?

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #3 on: Jul 05, 2006, 04:05:50 pm »

I allways do that (visit this site without www to see Smiley )

It worths to do permanent redirects when there are links to both urls.
I makes sense, but why is this not a default configuration on all apache webservers?

I guess because the Apache team doesn't care about SEO Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Jul 05, 2006, 04:09:13 pm »

yes, this people care more about servers then internet .... Wink

about the rule I thought that this one should work:

Code:
RewriteCond %{SERVER_NAME} !^www\.finalwebsites\.com$ [NC]
RewriteRule (.*)    http://www.finalwebsites.com/ [R=301,L]

but it doesn't

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #5 on: Jul 05, 2006, 04:17:11 pm »

I am out of office right now, so I can't see any example, but I think the right should be something like :

Code:
RewriteCond %{SERVER_NAME} ^\.finalwebsites\.com$ [NC]
RewriteRule (.*)    http://www.finalwebsites.com/ [R=301,L]

or if you prefer the php way :

Code:
<?php
if ( $_SERVER['HTTP_HOST'] != 'www.finalwebsites.com'  )
 
header (.....

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Jul 05, 2006, 04:21:46 pm »

I think your condition is the simple solution, hehe

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jul 05, 2006, 04:32:59 pm »

a little bit different:

Code:
RewriteCond %{HTTP_HOST} ^finalwebsites\.com$ [NC]
RewriteRule (.*) http://www.finalwebsites.com/$1 [R=301,L]

and this is a usefull bonus:
http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png
« Last Edit: Jul 05, 2006, 04:36:03 pm by olaf »

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3141
Tags : php google apache seo Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: leading www in url
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:52:18 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.