![]() |
![]() |
![]() |
|
Featured Articles: --- Other Sites --- We are not responsible for the content of third part website's. -------------------------------- Credit Centre 0 M G . C O M --------------------------------
Tools: Online Port Scanning Tools |
Home -> Articles & Tutorials -> .htaccess -> 301 Redirects
Tutorial -:- 301 Redirects -Ever go through the nightmare of changing significantly portions of your site, then having to deal with the problem of people finding their way from the old pages to the new? It can be nasty.
There are different ways of redirecting pages, through http-equiv, javascript or any of the server-side languages. And then you can do it through htaccess, which is probably the most effective, considering the minimal amount of work required to do it. "301 Redirects" or "Permanent Redirects" are placed in the .htaccess file of your website and are supported by all major search engines including Google. When you add a redirect it makes your webserver check first to see if the page being requested is listed in the .htaccess file. If it finds a redirect for the page being called, it forwards the browser it to the new page you have specified: Redirect 301 /olddirectory/oldfile.htm http://yoursite.com/newdirectory/newfile.htm Note that there are 3 parts to that, which should all be on one line in a plain text file called ".htaccess" in the root of your website. First the Redirect command itself [Redirect 301], then the location of the file/directory you want redirected relative to the root of your site [/olddirectory/oldfile.htm] and finally the full URL of the location you want that request sent to [http://yoursite.com/newdirectory/newfile.htm]. Each of the 3 is separated by a single space, but all on one line. You can also redirect an entire directory by simple using Redirect 301 /olddirectory http://yoursite.com/newdirectory/ Using this method, you can redirect any number of pages no matter what you do to your directory structure. It is the fastest method that is a global affect. That's got to be one of the most useful things you can do with .htaccess And on we go... again
|
| Home :: Tutorials :: Online Tools :: Services :: Contact Us :: SiteMap © WWW Security Services 2004. Part of the Live Internet Entertainments Group of Website's. |