Gooruze

First VisitRegister with GooruzeLog in to Gooruze
 
   
 

Article Rating

GoodGoodGoodGoodGood 4.00 I wish I wrote that from 2 votes
(309 Visits)
 
 

Magic of .htaccess file

by kiranvoleti Novice(November 2008) (rank 500+)
 
 
Mailemailprint
Reportreport 

The .htaccess file and the power it has to improve your website. Although .htaccess is only a file, it can change settings on the servers and allow you to do many different things, the most popular being able to have your own custom 404 error pages. .htaccess isn't difficult to use and is really just made up of a few simple instructions in a text file. If your server runs Unix or Linux, or any version of the Apache web server it will support .htaccess, although your host may not allow you to use it.

There is a huge range of things .htaccess can do including:

password protecting folders, redirecting users automatically, custom error pages, changing your file extensions, banning users with certian IP addresses, only allowing users with certain IP addresses, stopping directory listings and using a different file as the index file.

Custom Error Pages

The first use of the .htaccess file which will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your host's error pages or having no page.

This will make your site seem much more professional in the unlikely event of an error. It will also allow you to create scripts to notify you if there is an error (for example I use a PHP script on Free Webmaster Help to automatically e-mail me when a page is not found).

You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file: ErrorDocument errornumber /file.html If the file is not in the root directory of your site, you just need to put the path to it: ErrorDocument 500 /errorpages/500.html

These are some of the most common errors:

401 - Authorization Required

400 - Bad request

403 - Forbidden

500 - Internal Server Error

404 - Wrong page

Then, all you need to do is to create a file to display when the error happens and upload it and the .htaccess file.

http://www.toputop.com

 
 

Any contributed content above is the subjective opinion of that member or external author, and not of Gooruze.com Pty Ltd. View our House Rules for more details.

 
 

Related Articles

No related articles available

Bookmarks

No bookmarks available

 
 

Related keywords: dotndot, error, htaccess, internet, marketing, page, pages, seo, toputop

 
  ARTICLE RATING
GoodGoodGoodGoodGood 4.00 I wish I wrote that from 2 votes
 
 

Thankyou for your vote (you can change your vote at any time). Please leave some helpful comments about this article using the box below.

 
 

Help us rank this article

Vote: ExcellentExcellentExcellentExcellentExcellent
Vote: GoodGoodGoodGoodGood
Vote: AverageAverageAverageAverageAverage
Vote: PoorPoorPoorPoorPoor
Vote: Very PoorVery PoorVery PoorVery PoorVery Poor

Share it now

 
 

Add a comment

 
 
Add a comment on this article.
 
 

Comments

 
 

Re: Magic of .htaccess file

markowe
Vote:

December 2008

.htaccess is definitely serious voodoo - it really comes into its own when you start using mod_rewrite to turn these links:

blabla.com?articleid=435&viewcomments=true

to

blablac.com/how-to-make-scotch-eggs/comments

and a whole host of other groovy stuff...

Reply Reply Report
 
 

Invite someone to Gooruze

Home | Read News | Post News | Read Articles | Write Articles | Q & A | Groups | Activity | Members | More

Privacy Policy | House Rules | About Us | Contact Us | House Blog | FAQ | Advertise With Us

© Copyright 2007 Gooruze ™ | Built by Market United