Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/mumbaime/public_html/viewarticles1.php on line 7

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/mumbaime/public_html/viewarticles1.php on line 12
-
Mumbai Directory Home | Contact Us | About Us | Forum | Terms & Conditions
Mumbai Directory Mumbai Directory Mumbai Directory
 
Mumbai Directory
Make Your Home Page | Refer to friends | Advertisement | Sitemap
Mumbai Directory
Uncover Mumbai
 City Guide
 • About Mumbai
 Yellow Pages
 Classifieds
 Movies show timings in mumbai
 Theatres in Mumbai
 News
 • Cricket
 • Movie
 • Business
 • International
 Mumbai Temperature Today
 Sports Center
 Places to visit in Mumbai
 Mumbai Map
 Career / Jobs
 Articles & Tutorials
 Jokes
 STD Codes
 ISD Codes
 PIN Codes
 Police Telephone Numbers
Home Articles & Tutorials Articles




Features of htaccess

1] Redirect user request
2] Protect our data from unauthorized user
3] Handle 404 errors
4] save bandwidth
5] Change Default Page(order is followed)
6] Avoid the 500 Error

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-


by Raj Mehta
http://www.mumbaimetroonline.com




Copyright © 2012 , MumbaiMetroOnline.com , All rights reserved. Home | Contact Us | About Us | Forum | Terms & Conditions
Site Map | Web Resources | Refer to Friends | Advertisement