<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]