1] Redirect User Request
Redirect user request with ’/’ as separator <IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^store\/(.*)\/(.*).html$ subcategories.php?cat=$1&cid=$2
</IfModule>
Redirect user request with ’ – ’ as separator <IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)-store-(.*)-(.*).html$ subcategories.php?cid=$3&page=$2
RewriteRule ^(.*)-Article(.*)-page(.*).html$ viewarticles.php?category=$1&cid=$2&page=$3
RewriteRule ^search(.*).html$ searchresult.php?page=$1</IfModule>
2] Protect Data
Suppose you want to control access to your one folder say ’includes’
Your can deny access for all
# comment goes here
Deny from all
Just allow a particular lan to access your folder(no entry outside of lan)
#comment goes here
Order deny,allow
Deny from all
Allow from 192.168.0.0/24
3] Error handling
Some times your http request generate 500 error even there is no problem with your script.
It is working ok on your test server. So in that case you have to handle this error and redirect user to some page rather than prompt error.
ErrorDocument 404 /error-page.html
4] We can save bandwidth too
<ifModule mod_php4.c> php_value zlib.output_compression 16386
</IfModule>
5] Change Default Page(order is followed)
DirectoryIndex myhome.htm index.htm index.php
6]
Avoid the 500 Error
# Avoid 500 error by passing charset
AddDefaultCharset utf-
|