www vs non-www (301 redirect)

October 28th, 2006

301 redirectMost sites are accessible through either http://website.com as well as http://www.website.com. If anyone gave you a URL without the www would you assume that the same domain with a www would take you do a different site? Of course not. However, search engines are not always that smart. They may see http://fromthefrontend.co.uk and http://www.fromthefrontend.co.uk as two different sites.

Why is this a problem? Well it could have a negative effect on your search engine ranking. The “two sites” maybe viewed as a duplicate entry or you may have in cases promoted a www version and in others a non-www version without noticing and thus your efforts are diluted.

The solution?

Redirect traffic from your non-www to your www url (or visa versa). There are many ways to redirect a page - meta refresh, an info page advising to go to the correct url etc. But in this case your best option is the 301 redirect.

There are 2 main reasons
1) It is search engine friendly and will preserve your exisiting ranking
2) Most webhosts do not enable you to direct traffic for www and non-www to different destinations so you couldn’t put an info page or metta refresh in place to redirect the traffic
3) Using the wrong method can get you BANNED from google as Business.com discovered. Check out the full story on webpro

Fortunately the 301 redirect is easy enough to implement. You will need to be able to use .htaccess files (i.e using a Linux server running Apache and the Mod-Rewrite moduled enabled).

Continue reading »

Ask the Guru: Custom 404 (and other error) pages

October 23rd, 2006

What happens when a user is sent a link to your site (or manually types your URL) there’s a typo? What happens if you have a broken link on your site? What happens when a search engine brings up results for your site but it’s for a page you’ve removed?

The visitor is presented with their browsers (or webhosts) ghastly 404 page with no link to the correct page. The chances are the visitor may not bother to try and strip the URL down to your domain and search for the page, they’ll just close you page and look else where.

What can be done to avoid this? A custom 404 page! And example can be seen at MyPetsite.co.uk/ - enter anything random at the end and the custom 404 page will appear.

The .htaccess technique.
This method is designed to work on an apache server with html pages.

This technique can also be used to create different error pages for 403 - forbidden, 401 - unauthorised, 501 - Unable to connect to server etc. However, if simplicity is what you are after than you can have all such errors can be directed to the same page.

Continue reading »

    About

    Although originally designed to document my work and new web development tricks I learnt it has expanded to cover tech and news that I find interesting so in addition to tutorials and interviews expect to see product reviews and tech news too. If you enjoy please comment. David

    Blogroll
    • Adele Kirby - Freelance Writer and most chipper/perky person alive
    • Alex Pullin - Freelance Tech Writer and former PR queen
    • Display: Block - Blog of fellow developer Savell Martin
    • Molly E. Holzschlag - Web standards advocate and Genious
    • Nate Laxon - Funny guy and music guru
    • Paul Boag - Helping website owners and promoting webstandards. The King of Web Design Podcasts
    • Poached Online - news/current affairs/political comment: no eggs
    • Tale of 2 Blogs - Blog about my other blogs
    Admin
  • From Display:Block
    • SpringWidgets
      RSS Reader
      This widget is the staple of our platform. Read all your feeds right here with this one widget - Supported feeds are OPML, RSS, RDF, ATOM. Watch your favorite Podcast in the embedded Video Player on the Desktop or publish your own video playlist to your site for others to view!
      Visit the Widget Gallery