Webmaster Tools, Tips and Tricks

 





 
Sensational 144075358



This site is powered by the ICQ2Go Panel © 2002 ICQ Inc. All Rights Reserved. Use of ICQ2Go Panel is subject to the ICQ Terms of Service.

Join our Informative
Newsletter & Group



Google
Web ekhwan.com
hikmah.ekhwan.com










Web Developers Must Use It: .htaccess

A lot of sites everyday, and in most of them wont use this important tool.

.htaccess is a simple and powerfull tool that can be used to redirect error pages, deny users by ip, password protection and more...
Here is a simple example code:
code:

DirectoryIndex index.php

ErrorDocument 404 http://site.com/erro.php?id=404
ErrorDocument 502 http://site.com/erro.php?id=502
ErrorDocument 503 http://site.com/erro.php?id=503
ErrorDocument 501 http://site.com/erro.php?id=501


.htaccess is the file extension. It is not file.htaccess or something.htaccess, it is simply named .htaccess
Remember always to upload the file as ASCII.

Directory Index is the file that ll be called when you open a a folder page. You can put only one like
code:
DirectoryIndex index.php

or more like
code:
DirectoryIndex index.php index.html index.shtml


For me the more important tool is Error Pages.
To use it, just put:
code:
ErrorDocument ERROR PAGE

The PAGE is the document error default page.
The error is the number of the possible error:
Here the possibles Errors:

code:

Successful Client Requests
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported



You can only upload a .htaccess for your server in root www folder that error pages ll be up and all.
EX: You set up a error page 404 for site.com/404.htm
When someone try to open any file or folder that is under www.site.com/ will be redirected to www.site.com/404.htm
Like www.site.com/ada/ada/da
Like www.site.com/adadadada.php

I hope this helps all.

Its a simple tutuorial, just for those that dont know it.

More help open:
http://www.freewebmasterhelp.com/tutorials/htaccess/
http://www.javascriptkit.com/howto/htaccess.shtml

__________________
Help to be Helped!

Labels:

0 Comments:

Post a Comment

<< Home

© Copyright Ekhwan - The Botherhood Beyond Boundaries
Your Gateway to Establishing an Online Presence.
Tel: +971-6-5636554 Fax: +971-6-5321319
Postal Address: P O Box 19860, Sharjah, UAE

Owned by a proud member of the Dawoodi Bohra Muslim community. Bohras adhere to the Shi'a Fatimi tradition of Islam, headed by the 52nd Dai al-Mutlaq, Syedna Mohammed Burhanuddin Saheb (TUS).