Posted The: 05/01/2009 At: 1:22
Contents:
htaccess can also be used to redirect pages. There are two types of used redirects known to me, one is the permanent 301 redirect, and the other is the 302 temporary redirect.
Its important that we redirect moved pages to their new location, otherwise we might lose visitors who get stuck at 404 error pages. And it can be hard to hold on to your visitors today, so we likely would be doing everything we can to make them want to come back, within certain limits.
The temporary redirects are mostly used doing major downtime, this can be due to site updates, or maintenance periods.
Used when a page is moved permanently, often used when changing domains, or changing the site structure.
The examples below covers how to redirect your entire site, and how to just redirect a single page.
Redirect 301 /old-page.html http://www.brugbart.com/newpage.html
When you have changed the file extension, for example to php from html, use a regular expression to remember the file name.
RedirectMatch 301 (.*)\.html$ http://www.bugbart.com$1.php
Note. The content of the parentheses is remembered, or back-referenced. The . dot allows any character, and the * asterix allows none or more characters to be present.
Redirect 301 / http://www.example.com/
Note. When wanting to use the Temporary Redirect, simply change 301 to 302.
Comments: [0]
© Brugbart Webdesign