Paulund

htaccess Category

Set Expire Headers In htaccess

A way that Browsers try to help speed up rendering the page is by taking static data and cache it. These are things like images, CSS and JavaScript files. As Browsers are going to cache these bits of data you can actually set an expiry so the Browser will know not to cache these anymore.

The Browser will keep serving these until the date you set.
Read More →

Using htaccess To Remove The www

www
In a earlier article I mentioned how to add the www. to your domain if users come through to your domain without it. Now I will explain how you can do the opposite and remove the www. from your domain if a visitors comes through with it or with any sub-domain.

Below is a snippet of the small bit of code you will need to perform this do.

Copy and paste this into your .htaccess file and it will remove any sub-domain from your domain name and redirect it to your main domain.
Read More →

Add www Subdomain To All URLs Using htaccess

For SEO it is important to use a set standard of how you present your domain. The most popular approach is to use the famous sub-domain www. Many people don’t know this but http://www.domain.com is the same as http://domain.com, you will be sent to the same page but they are different URLs.

For SEO if a search engine saw http://www.domain.com it is crawl the page, check the content and index the content. Then later if it goes and crawls http://domain.com the search engines will see the same content but on different URLs and think it is duplicate content and therefore will penalise this domain in the search engine ranking.
Read More →