Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

The Ultimate HTML/xHTML/DHTML 301 direct/forwarding thread!

XHTML DHTML HTML dhtml xhtml

  • This topic is locked This topic is locked
No replies to this topic

#1 Dan


    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 140 posts

Posted 28 June 2006 - 04:58 PM

If you don't know what a HTML/xHTML/DHTML 301 redirect is, you will by the end of this thread! If you need to redirect a page, unfortunately it isn't as simple as using one of the various methods - only the 301 redirect will preserve search engine rankings for the page. It is the most efficient, search engine friendly method for website redirection - the code 301 is interpreted as "moved permanently".

Here is how to perform a 301 redirect in the 3 afformentioned coding languages:


  • Create a .htaccess file by opening up notepad, or a similair text/txt editor and save the file as .htaccess with no extension.
  • Place this code in your .htaccess file:

    redirect 301 /old/old.htm http://www.yoursite.com/new.htm

    OR, if you are redirecting to a new url, you need the following code:

    redirect 301 / http://www.yoursite.com/new.htm

    If you already have one of these files - make sure you leave a line before adding the code!

  • Save the file and upload to your server root folder.

  • Test the redirect works by visiting the old page - you should automatically be redirected!

  • 0

Also tagged with one or more of these keywords: XHTML, DHTML, HTML, dhtml, xhtml

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download