[ « GO BACK ] [ SEE ALL TIPS ]
What are .htaccess files and what are they used for?
26-11-2006
The .htaccess file is a configuration text file for Apache web servers. This file can modify the configuration of the server on a directory basis and can be used for many tasks, being these some of the most common ones amongs users:
- Protect your folders with user and password
- Create redirections to customized error pages
- Deny or restrict acces by IP address
- Redirect to other URLs
You can make use of this file if your hosting party doesn't let you change those settings via Control Panel.
To redirect to a customized error page:
1. Put the following code into the file:
ErrorDocument 404 /error404.php
To redirect myweb.com to www.myweb.com:
RewriteEngine on RewriteCond %{HTTP_HOST} ^miweb.com RewriteRule (.*) http://www.miweb.com/$1 [R=301]
Don't want to index PHPSESSID in search engines?
php_value session.use_trans_sid 0 php_value session.use_only_cookies 1
[ « GO BACK ] [ SEE ALL TIPS ]
|