Google
Free Ads
Ads United Kingdom
Ads Deutschland
Ads France
Ads Brasil
Ads India
Ads Mexico
Ads Argentina
Ads Österreich
Ads Belgique
Ads Chile
Ads Venezuela
Main Menu
HomeViso - Industry BookDictionaryFreeadsNewsDownloadsWeb LinksForumTutorialsPicture galleryNewsletterFAQRSS/XMLPartner SitesInformation
Information

Webmasters
Philippe 
frank 
ralph 

CMS - Content Management : .htaccess, Part 1 - Introduction

Recommend Us

Recent Section Articles
 · Part 3 - Password Protect..
 · Part 1 - Introduction
 · Part 2 - .htaccess Comman..
 · test Article 4 this
 • Propaganda I


_NSEC_KOPF
Part 1 - Introduction
Published by: frank, On: 2006/11/16 
Will My Host Support It?

This is probably the hardest question to give a simple answer to. Many hosts support .htaccess but don't actually publicise it and many other hosts have the capability but do not allow their users to have a .htaccess file. As a general rule, 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.

A good sign of whether your host allows .htaccess files is if they support password protection of folders. To do this they will need to offer .htaccess (although in a few cases they will offer password protection but not let you use .htaccess). The best thing to do if you are unsure is to either upload your own .htaccess file and see if it works or e-mail your web host and ask them.

What Can I Do?

You may be wondering what .htaccess can do, or you may have read about some of its uses but don't realise how many things you can actually do with 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.

Creating A .htaccess File

Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though, all you need to do is to save the file by entering the name as:

".htaccess"

(including the quotes). If this doesn't work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program.

Warning

Before beginning using .htaccess, I should give you one warning. Although using .htaccess on your server is extremely unlikely to cause you any problems (if something is wrong it simply won't work), you should be wary if you are using the Microsoft FrontPage Extensions. The FrontPage extensions use the .htaccess file so you should not really edit it to add your own information. If you do want to (this is not recommended, but possible) you should download the .htaccess file from your server first (if it exists) and then add your code to the beginning.

Custom Error Pages

The first use of the .htaccess file which I 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

For example if I had the file notfound.html in the root direct
ory of my site and I wanted to use it for a 404 error I would use:

ErrorDocument 404 /notfound.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.
Printer Friendly Page  Send this article to a Friend
[ Back to .htaccess | Return to Sections Index ]

 • Propaganda II



Search
Language
DeutschEnglishFrench
Recent Comments
 ·eXV2.org is forked
  I'm already in outs
 ·2.04 Viso - Indust
  This is a test comm
 ·FCKeditor File Upl
  ExV2 did not use fi
Recent Downloads
Download Now! Yellow Pages Module
Sorry, you dont have the permission to perform this action. Database: UML Sheet topic..
Sorry, you dont have the permission to perform this action. E-Xoops language defines ..
Sorry, you dont have the permission to perform this action. E-Xoops Function Referenc..
Sorry, you dont have the permission to perform this action. E-Xoops Function Referenc..
Sorry, you dont have the permission to perform this action. E-Xoops Function Referenc..
Sorry, you dont have the permission to perform this action. E-Xoops defines
Sorry, you dont have the permission to perform this action. E-Xoops Database Relation..
Sorry, you dont have the permission to perform this action. E-Xoops Data Dictionary
Sorry, you dont have the permission to perform this action. E-Xoops mainfile.php
Dictionary
ASP: A specification for a dynamically created Web page with an .ASP extension that utilizes ActiveX scripting -- usually VB Script or Jscript code. When a browser requests an ASP page, the Web server generates a page with HTML code and sends it back to ...
Login
Nickname

Password


Lost Password?

Don't have an account?
Register ?
powered by AdSense
bamaGalerie3

Category: ExV2 / RMLL / LSM 2005 in Dijon
more pictures
Recent Links
Partners

http://sourceforge.net/projects/exv2/

http://www.picktools.de

http://www.i-s-o.com

http://www.rss-scout.de

http://www.e-xoopsfr.com

http://www.stapeliaart.de

http://www.crawltrack.fr/