View Full Version : www and no www


wlh
05-25-2004, 03:46 PM
So I recently had to switch my pr5 website from one server to another. I originally had my links setup as http://domain.com/link.html which all had pr's of 4. Now that I have moved to a new server, it doesn't let you link to a page without the www. It automatically adds in the www for you. I've been messing with it for a while and it will still make the link appear http://www.domain.com/link.html

Now the problem is all my sub pages have to be given a brand new pr. I was hoping to get all my subpages a pr5 on this next update.

Does anyone have any ideas/advice about this?

Thanks

dilligaf
05-25-2004, 05:54 PM
Are all the people linking to you doing so without www? If not, I'd say go with the www and everything will right itself in a couple of updates. If so (everybody linking to you without www) I'd talk to my host. It should be an easy adjustment on their end, but IMO the determinant should be how outside sources link to you.

seo guy
05-25-2004, 09:11 PM
you might be able to use mod_rewrite via the htaccess file, my friend Eric from owlcroft was commenting on this the other day, I will invite him over here and see what he has to say on it.
Stay tuned!

Robert
05-25-2004, 09:37 PM
Hi Wlh,

What reason does your new host give for not serving pages at the domain level? Technically, there is not any reason the new host cannot continue the same way you had it in the past.

There are a couple things that affect this. If you are hosted on a virtual server, the web server must be configured to respond to a particular domain/sub domain (actually can be numerous domains/combinations per IP).

If you have a static IP assigned <U>just to you</u>, most hosts will just direct all traffic to that IP address, and not care what the domain/sub domain is.

If it is a virtual server/host, unless the new company is willing to make a change, there is not much you can do. You can't get the traffic to you, so you can't even attempt a script to try to compensate for the change at that point.

If you do have a static IP, and the server is left open, you are then left with the second potential cause of your trouble.

The DNS server is what answers any requests for www.domain.com or domain.com and directs the incoming requests where to go. If you have an open web server, and a static IP, you just need to get the DNS record to point the main domain to the new IP address of the new host.

It is not very complicated at all, and if you would like to post your domain or pm me, I would be happy to give you an idea where you stand.

Best wishes. - Robert

P.S. You mention you have been "messing with it for awhile". I would be careful about actively submitting the (www) new domain if you are going to try to use the root domain because of the potential appearance of duplication of sites.

Also, if you have many valuable incoming links, it may be easier to find a more helpful host than try to get them all changed to the new sub domain.

owlcroft
05-25-2004, 10:53 PM
If your server is running on Apache software, you can probably use a local .htaccess file: check with your host to be sure. If so, though, you can take control of a great deal of your site's operation.

One powerful aspect of .htaccess files is the Rewrite Engine, which allows you to transform incoming URL calls and also to send out redirects, such as a 301 "Permanently Moved" Redirect so that visitors' browsers--and, more important, SE robots--see the old/wrong URL as a link to what you want as the new/right URL.

Here's the salient portion of the actual .htaccess file fromone of my sites:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# ----------------------------------------------------------------------------------------------
RewriteCond %{HTTP_HOST} www.seo-toys.com
RewriteRule ^(.*) http://seo-toys.com/$1 [L,R=301]
# ----------------------------------------------------------------------------------------------
</IfModule>

The bracketed line pair, the < > statements define a conditional block that will only be attempted if the server is running the mod_rewrite module. If it is, the first thing we do is turn on the Rewrite Engine, then set our site's root directory as the "base" for all further operations.

That requisite preliminary work done, we can set about doing all sorts of rewrite things. What the particular two lines shown do is relevant to your inquiry. The first establishes an IF condition: IF the incoming URL request is using "www.seo-toys.com" as the server designation, THEN the next line will take effect. That next line will cause the server to issue a 301 redirect response to the calling browser (or SE robot) pointing it at the same URL only without the leading "www." part. It doesn't matter whether they were asking for your front page or for one five subdirectories deep: all get redirected to the wanted form just by that one line.

You can do lots of other highly useful things with mod_rewrite (famously, one can convert calls to what look like static html pages into calls to a php script with parts of the URL turned into passed parameters). The Apache documentation for .htaccess files is on line:

http://httpd.apache.org/docs/howto/htaccess.html

But if you have the ability to use a .htaccess file, you could use the very lines given above, just substituting your domain for seo-toys.com

Check with your ISP and talk it over.

Pyrrhonist
05-25-2004, 11:21 PM
Great post, Owlcroft! Nice to see you join the club!!

I was thinking, would it be possible for you to do a permanent 302 redirect from the old to the new sub? (or lack thereof). And if you could, then wouldn't all your PR get passed on automatically?

seo guy
05-25-2004, 11:22 PM
301 or 302 would work Bob, 301 is suggested by the big G though

wlh
05-26-2004, 08:43 AM
Thanks for the tips guys, I have'nt been able to get ahold of the main server admin. I went ahead and tried what owl was saying but it didn't work. I set all my links in my navigation to : http://domain.com/link but once I click on it, the url changes to http://www.domain.com/link

wlh
05-26-2004, 09:02 AM
OK so I talked to my server admin and we got it figured out.

I had my links on my navigation setup link this: http://domain.com/link
which, once click on it would redirect as: http://www.domain.com/link

So my admin told me to ad a traling slash at the end of my links: http://domain.com/link/

Now once I click on it - it doesnt add in the www. It stays the same: http://domain.com/link/

Never would have guessed this one...