rules of htaccess


<IfModule mod_rewrite.c> # condition start for our module rewrite is exist or not
RewriteEngine on #start our apache rewrite engine
RewriteBase /magento/ # rewrite base url its used when if you want to use your rewrite rule in sub directory
#for example… http://www.domain.com/subtest/
#in above link if your root link is subtest you must be declare what you base/root of server

#always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(fold1|fold2|fold3)/
RewriteCond %{REQUEST_FILENAME} !-f  # if in url request file name and it will be not exist…
RewriteCond %{REQUEST_FILENAME} !-d # if in url request directory name and it will be not exist…
RewriteCond %{REQUEST_FILENAME} !-l # if in url request link and it will be not exist…
RewriteRule .* index.php [L] # all links sent to index.php page
#[L] -> Last Rule — Server stop rewriting after the preceding directive is processed.
</IfModule> # condition end

 

Remove “index.php” from your link

RewriteEngine On
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s