Category: htaccess

Must have htaccess file for every website

I have come across some client websites which do not have the proper rules in place and due to this their websites are exposed to attacks from hackers. I have put together a basic htaccess file what each website must

Tagged with:

How to 301 redirect static URLs using htaccess

If your website has static URLs i.e. do not contain any query string parameters and you need to redirect your old website URLs to your new website URLs then you don’t have to fear anymore. You can write simple redirect

Tagged with: ,

How to 301 redirect non-www URLs to www URLs using htaccess

If your website can be accessed by two different URLs then your website could be penalized for duplicate content by the search engines which would be costly in terms of your rankings. For e.g. if your website can be accessed

Tagged with:

How to 301 redirect SSL URLs to non-SSL URLs using .htaccess

If you would like to rewrite your SSL URLs to non-SSL URLs then please add the following code to your .htaccess file. RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://www.adeelsarfaraz.com/$1 [R=301,L] The above code should be used in the following conditions: 1.

Tagged with:

301 redirect folder url to root url using htaccess

Our SEO department recently tweaked the URLs of a client website in order to improve the search engine rankings. The change was minor and they just removed a category path from the URL which shortened the actual length of the

Tagged with: , ,

How to disallow executable scripts from executing using htaccess

I came across an issue recently in which the client complained that his hosting provider had suspended his website account due to large number of spam emails being sent from this website. The client website was a small 5 page

Tagged with: ,
Top