9, July 2008

leading www in url - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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


It's time to use PHP5!


« on: Jul 05, 2006, 04:52:19 PM »

Hello,

I learned that a website need to answer on both request like:
www.domain.com Visit through proxy
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?


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7943
40607 credits
Members referred : 3



« Reply #1 on: Jul 05, 2006, 04: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
Promote your blog for free.... Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 05, 2006, 04: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?


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7943
40607 credits
Members referred : 3



« Reply #3 on: Jul 05, 2006, 05: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
Promote your blog for free.... Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Jul 05, 2006, 05: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


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7943
40607 credits
Members referred : 3



« Reply #5 on: Jul 05, 2006, 05: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
Promote your blog for free.... Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


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

I think your condition is the simple solution, hehe


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jul 05, 2006, 05: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 Visit through proxy
« Last Edit: Jul 05, 2006, 05:36:03 PM by olaf »


Last blog : 4th of July Lottery from TemplateMonster.com
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Jul 09, 2008, 12:15:59 PM





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!


Forum Statistics
Total Posts: 35.588
Total Topics: 7.355
Total Members: 3.661
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: komrad

26 Guests, 6 Users online :

18 users online today:



Readers

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