Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Why Do Some Pages Lack the "www." Prefix?

Why Do Some Pages Lack the "www." Prefix?
Thread Tools
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 24, 2005, 11:17 AM
 
When you have a website whose top-level index page resolves fine with "http://www.mydomain.extension", why do some subpages resolve to "mydomain.extension" (i.e., without the preceding "www.")? I would prefer it to always be preceded by www. --- how do I make sure that happens?

I checked and all of my pages have the <base href="http://www.mydomain.extension" /> tag (inside of my <head></head> tag), so that is apparently not the problem.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 24, 2005, 12:05 PM
 
First off... the www in front of things is a convention. It is a leftover from the ancestry of the internet when the whole port system (such as port 80 for web pages) was still a bit new. At that point you would have ftp.somedomain.com for ftp traffic, www.somedomain.com for web, etc... and they would usually all resolve to the same machine.

Now people have come to expect it, so it is still there. It sounds like your DNS server (the one hosting the name) is properly set up so the both the root domain and the www subdomain point at the same place, but it might be that the apache.conf reference for your site gives the root domain as the canocial name, so every time it is redirected it goes there. You just have to change that... but this is not really an issue, it is just your personal preference.
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 24, 2005, 01:20 PM
 
Originally posted by larkost:
but this is not really an issue, it is just your personal preference.
Exactly. So I guess I have to find my apache.conf file, eh? Maybe it's in a directory above my public_html/ folder....
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 24, 2005, 04:07 PM
 
oops.
     
Dedicated MacNNer
Join Date: Apr 2000
Status: Offline
Reply With Quote
Mar 25, 2005, 12:02 AM
 
Originally posted by selowitch:
When you have a website whose top-level index page resolves fine with "http://www.mydomain.extension", why do some subpages resolve to "mydomain.extension" (i.e., without the preceding "www.")? I would prefer it to always be preceded by www. --- how do I make sure that happens?
Since the DNS is setup properly (since you get content from both), you'll need to configure the server itself to do that. Usually a mod_rewrite directive can be used (that's what I do usually), but there may be other methods.

It might also be that your server is currently setup to redirect anything coming from port 80 to http://yourdomain.ext
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2