Irish SEO,  Marketing & Webmaster Discussion

 

non www domain redirect to www domain

This is a discussion on non www domain redirect to www domain within the Server / Technical Administration Tips and Queries forums, part of the Webmaster Help category; Hi, I'm new to all this and am just learning as i go... I'm setting up my first site which ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Server / Technical Administration Tips and Queries

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-07-2008, 07:24 PM
Frontpage User
 
Join Date: Jul 2008
Posts: 13
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
damoth will become famous soon enough
Default non www domain redirect to www domain

Hi,

I'm new to all this and am just learning as i go...

I'm setting up my first site which is www. portumna .net

My domain is accessible through both http:// www. portumna .net and http:// portumna .net. It is appearing in google as both seperately under different search terms and the same thing seems to be happening in yahoo.

I have been advised to do a 301 redirect from http:// portumna .net to http:// www. portumna .net to avoid any potential problems with search engine rankings.

However, the site is using shared hosting on a windows server with the HELM control panel and i have been told i can't do the redirect i need to on this system. The support for the hosting company said all they could do is disable the non www domain so that only the correct one will be active.

This sounds OK to me but i just wanted to check with people that have experience with this kind of thing..

Thanks in advance.

P.S. My site won't be completed for about another 4 weeks so i don't mind if i'm not in the rankings at all for a while. At the moment i just have a temporary homepage up so people will know i am working on it.

damoth

Last edited by damoth; 09-07-2008 at 07:26 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-07-2008, 07:42 PM
blacknight's Avatar
Web Slave
Recent Blog:
 
Join Date: Jan 2006
Location: Ireland
Posts: 6,521
blacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to behold
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

I think someone posted some asp code for redirects on here a few days ago. I'd recommend you search the forum

You can also specify the "preferred" domain in the Google webmaster console, which may help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-07-2008, 09:01 PM
ghost's Avatar
Wannabe Geek
 
Join Date: Dec 2007
Location: Ennis
Posts: 166
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ghost will become famous soon enough
Default

what server side code are you using asp php ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 09-07-2008, 09:32 PM
ghost's Avatar
Wannabe Geek
 
Join Date: Dec 2007
Location: Ennis
Posts: 166
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ghost will become famous soon enough
Default

Hostname Redirect non-www to www
This code should be inserted into a global include file or any script which is executed for every page on the site before the page output begins:

For asp

Code:
<%
If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www."
        & Request.ServerVariables("HTTP_HOST")
        & Request.ServerVariables("REQUEST_URI")
    Response.End
End if
%>
For php

Code:
<?php
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') {
    header('HTTP/1.1 301 Moved Permanently'); 
    header('Location: http://www.'.$_SERVER['HTTP_HOST']
    .$_SERVER['REQUEST_URI']);
}
?>
Compliments of

301 Redirects in Apache .htaccess, IIS, PHP, ASP and ColdFusion - Beyond Ink
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 10-07-2008, 08:14 AM
Frontpage User
 
Join Date: Jul 2008
Posts: 13
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
damoth will become famous soon enough
Default

Thanks guys but the site is just going to be HTML. It will all just be static web pages.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 10-07-2008, 10:35 AM
ghost's Avatar
Wannabe Geek
 
Join Date: Dec 2007
Location: Ennis
Posts: 166
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ghost will become famous soon enough
Default

You are going to have your work cut out updating that lot.
How many pages to start ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 10-07-2008, 10:51 AM
Frontpage User
 
Join Date: Jul 2008
Posts: 13
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
damoth will become famous soon enough
Default

There will a lot of pages. It's a community based site so i hope to have a news page for each club / group in the area... The idea being that they will email me their news and i will add it.

Most pages will be mainly just text so one it's up and running, changes should just be added new text to pages already created.

I'm also going to have a weekly general news page which will involve adding a new page to the site for each weeks news.

I had considedered going with PHP but i only know the basics so it would take me extra time to learn that and i really need to have this finished in the next few weeks (which i am on track to do).

I'm hoping to have some free time next year when i can go back and tidy up stuff and probably convert to a scripting language when the site is established in the area and everyone knows about it but i just dont have time for that now...

What would you recommend to do for now with regards to the non-www & www domains?

Thanks.

damoth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 10-07-2008, 11:03 AM
ghost's Avatar
Wannabe Geek
 
Join Date: Dec 2007
Location: Ennis
Posts: 166
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ghost will become famous soon enough
Default

Quote:
Originally Posted by damoth View Post
What would you recommend to do for now with regards to the non-www & www domains?
damoth
Ask your host to switch you over to a linux system then you can use an htaccess file .

Good luck with the site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 10-07-2008, 11:46 AM
Frontpage User
 
Join Date: Jul 2008
Posts: 13
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
damoth will become famous soon enough
Default

OK, thanks..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 15-07-2008, 09:27 AM
Frontpage User
 
Join Date: Jul 2008
Posts: 13
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
damoth will become famous soon enough
Default

Thanks for the help with this guys,

I've switched over to Linux hosting and have my redirects working now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
domain, redirect, www

Thread Tools
Display Modes

Posting 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
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Domain Parking Script with FREE. COM DOMAIN! DomainZAar Marketplace Offers 0 12-05-2008 10:27 AM
New Domain name with 301 redirect Wenlock Search Engine Optimisation 6 18-03-2008 01:34 PM
nonwww redirect to www domain on windows server Vivid.ie Coding Help 1 04-12-2007 05:35 PM
Can you buy domain names with keywords and then redirect to you site? Ecologikids Search Engine Optimisation 9 24-07-2006 10:34 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 11:25 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0