Posts Tagged "HTACCESS"

How to group Security Headers for web application using htaccess?

How to group group Security for web application using htaccess? Group Security Headers htaccess X-XSS-Protection sets the configuration for the cross-site scripting filters built into most browsers. The best configuration is “X-XSS-Protection: 1; mode=block”. X-Frame-Options tells the browser whether you want to allow your site to be framed or not. By preventing a browser from framing your site you can defend against attacks like clickjacking. X-Content-Type-Options stops a browser from trying to MIME-sniff the content type and forces it to stick with…

Read More

Redirect from non-www to www in CakePHP

How to redirect from non-www to www in CakePHP? Put the following code into .htaccess in main directory <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www\..+$ [NC] RewriteCond %{HTTP_HOST} !=localhost [NC] RewriteCond %{HTTP_HOST} !=127.0.0.1 RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> Shashi Dhar KumarShashi Dhar Kumar Experience in Web/software development including client server and implementation using PHP, XML, MySQL and SQL Server. Experience of working on Apache, Linux projects,…

Read More

How to ensure your WordPress site’s security?

What is Security? Fundamentally, security is not about perfectly secure systems. Such a thing might well be impractical, or impossible to find and/or maintain. A secure server protects the privacy, integrity, and availability of the resources under the server administrator’s control. Your website can never be 100% secure. Hackers are always trying new things and discovering new vulnerabilities to exploit. The online world changes quickly and the same is true of security. Good security is about minimizing risk. If anybody…

Read More

301 redirect with htaccess

How to redirect web based page with .htaccess Following are the code to paste (be careful to write on .htaccess it can be messed up whole website if anything goes wrong) into .htaccess file 301 redirection for any domain : RewriteEngine On RewriteCond %{HTTP_HOST} !^www.olddomain.com RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L] newdomainRewriteRule ^$ http://www.newdomain.com [R=301,L] RewriteRule ^index.htm$ http://www.newdomain.com [R=301,L] RewriteRule ^index.php$ http://www.newdomain.com [R=301,L] RewriteRule ^index.html$ http://www.newdomain.com [R=301,L] RewriteRule ^index.shtml$ http://www.newdomain.com [R=301,L] RewriteRule ^index.asp$ http://www.newdomain.com [R=301,L] RewriteRule ^default.asp$ http://www.newdomain.com [R=301,L] RewriteRule ^index.aspx$ http://www.newdomain.com…

Read More

Increase your website speed through .htaccess in LAMP Technology

How to increase my website speed through .htaccess in LAMP Technology Many LAMP(Linux Apache MySQL PHP) driven websites today could easily decrease their bandwidth output and increase their speed through implementing caching and compressing their content. Even with the new high speed connections of today it is still highly important to improve websites efficiency and performance to increase the users experiences. This article goes over will decrease your bandwidth output. Lets get to increasing the performance efficiency of your website…

Read More

How to enable .htacces in localhost?

Enable htacces localhost – How to Enable htaccess in xampp (localhost)? Just go the Terminal and follow the following steps I enabled mod re-write by typing below command and restart the apache server. sudo a2enmod rewrite Now restart your apache2 by typing below command. sudo /etc/init.d/apache2 restart How to enable .htaccess in windows Using a text editor, open the httpd.conf file. In XAMPP, this file is found in the apacheconf directory Locate the following line of code: #LoadModule rewrite_module modules/mod_rewrite.so…

Read More

Redirect HTTP to HTTPS Apache secure connection

Most of the e-commerce website uses payment gateway for online payment. And, those sites uses SSL (secure socket layer) connection to transfer data to and from the payment gateway. Most of the sites uses “http” protocol and you can see “http” in the browser’s address bar. But in the Ssl connection, we need to redirect the browser to “https” which means that “Hypertext Transfer Protocol over Secure Socket Layer”. How to redirect the browser to https in PHP? First of…

Read More