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]

Upload large file in php using .htaccess


Here i want to share small tips for friends which is used to upload large file using htaccess rules.

Step 1. Create a .htaccess file in the root folder of web server.

Step 2. Put the below code in your .htaccess files

<IfModule mod_php5.c>
php_value upload_max_filesize 60M
php_value post_max_size 60M
php_value max_execution_time 60
php_value max_input_time 60
</IfModule>

Now you can upload maximum file size 60M.

You can change size of uploading as per you needed.