• Removing the requirement to type 'www' before my website URL
    7 replies, posted
Hey guys, We've all pretty much grown out of putting the www. before website URLs. I set up a personal website earlier this year (Deviantart portfolio with URL from Godaddy) and for some reason the site can't be accessed unless the www. is put before the URL. This is a problem because most of the more technically savvy visitors are going to assume it's offline if they try to visit it without typing the www. Any ideas on why this could have happened? Working link: [URL="http://www.zachogan.com"]www.zachogan.com[/URL] Broken link: [URL="http://facepunch.com/zachogan.com"]zachogan.com[/URL]
how have you setup the forwarding, it seems as though you are only forwarding the www cname, when what you need to do is setup a 301 redirect, this can be done on your domain control panel
You could always create a wildcard forward so it always goes to www. Such as *.zachogan.com as an A record.
The right way to set it up is to have an A record for your domain zachogan.com pointing towards your server. You can then create a CNAME record www which is an alias of zachogan.com. That way if you ever switch servers and update your A record the aliases of that record will also follow suit. Hope that helps.
[QUOTE=Chuteuk;42354870]The right way to set it up is to have an A record for your domain zachogan.com pointing towards your server. You can then create a CNAME record www which is an alias of zachogan.com. That way if you ever switch servers and update your A record the aliases of that record will also follow suit. Hope that helps.[/QUOTE] You should always make sure that your app uses either www or no www consistently as well. If you decide that you want no www, you should always redirect people who add the www to the same page without it. It's better for SEO to pick one and stick with it from what I've read.
- snip -
You can do it with wildcard redirects if your domain registrar supports that and you don't need to use your own nameservers, but if you do, use this .htaccess code to redirect non-www to www (That's what you wanted, right?) [CODE]<IfModule mod_rewrite.c> RewriteEngine on # Redirect non-www to www: RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com%{REQUEST_URI} [R=301,L] </IfModule>[/CODE] Now, you need to change [B]example\.com[/B] and [B][url]http://www.example.com[/url][/B] to your domain, keeping the excape character [B]\[/B] in the first one. [B]Edit:[/B] You do need a CNAME record called www.
I actually posted at a really inconveniently busy time for me Thanks so much for all of the information! I'll chase up those leads when I have a spare little while to deal with it. You guys are the bombest
Sorry, you need to Log In to post a reply to this thread.