You can use Mod_Rewrite to deny requests containing invalid characters, RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&]+\ HTTP/ [NC] RewriteRule .* – [F,NS,L] You…
If you want all your cgi, php, perl, py scripts not to run, but just display as source code. htaccess fil can help you by…
php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 In the above .htaccess file, uploading capability is increased by the four parameter…
You can cache the static files and improve your website’s performance. File caching is another famous approach in optimizing website loading time. Search engine will…
If you want to redirect from an old document to new: Redirect 301 /old/file.html http://yourdomain.com/new/file.html Use following for redirecting Entire Directory. RedirectMatch 301 /blog(.*) http://yourdomain.com/$1
Environment variables contain information used by server-side includes (SSI) and CGI. Set / Unset environment variables using SetEnv and UnSetEnv. SetEnv SITE_WEBMASTER “Jack Sprat” SetEnv…
If you run the risk of someone accessing your php.ini file directly through their browsers, you can limit access to them using htaccess file. Put…
If you are running php websites, and a php includes folder that is only used for the calling of your own php scripts. I know…
Error pages of your website like 404 not found, 403 access forbidden pages contains server signature i.e. server version number, operating system etc., such information…
Normally your server timezone is set to its local timezone. But as a webmaster, you can set your website timezone by date.timezone directive in htaccess…