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 ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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.. |
| |||||
| 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 |
| |||||
| 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
%>
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']);
}
?>
301 Redirects in Apache .htaccess, IIS, PHP, ASP and ColdFusion - Beyond Ink |
| ||||
| 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 |
| Tags |
| domain, redirect, www |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
| ||||
| | ![]() | |||
| | ![]() | |||