7
2009
Force www vs non-www to avoid duplicate content on Google Search
When you have your site accessible both under your_domain.com and www.your_domain.com you may come up with duplicate content on Google Search. To avoid such problems you can use the following lines in your .htaccess file to force only the www version of your web site: RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301] Note that the .htaccess should be located in the web site main folder. This will redirect all requests to the non-www [...]
7
2009
Duplicate content fix index.html vs / (slash only)
This similar to the www vs non-www version of your site work-around. As you might now you, by default you can access your site as http://www.domain.com/ and http://www.domain.com/index.html with some setups it can be index.php or index.asp or default.aps, etc. Unfortunately, this creates a risk of duplicate content from the search engine point of view. To avoid this, you can use the following ModRewrite rules in your .htaccess file: RewriteEngine on RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ [...]
7
2009
Make PHP to work in your HTML files with .htaccess
By default most web servers across the internet are configured to treat as PHP files only files that end with .php. In case you need to have your HTML files parsed as PHP (e.g .html) or even if you want to take it further and make your PHP files look like ASP, you can do the following: For web servers using PHP as apache module: AddType application/x-httpd-php .html .htm For web servers running PHP as [...]
Categories
- Diary (10)
- IT (19)
- Programming (6)
- Life (6)
- LTT App Store (1)
- Mechatronics (6)
- Others (1)
EverBot.com
EverBot twitter
- Looking forward to seeing Ice Cream Sandwich on my old little Desire. Gonna be in-ter-rest-ting! 2 months ago
- I've learned that everything is uncertain. 4 months ago
- Every morning starts freshly and energetically when I think of YOU <3 4 months ago
- what makes you happy? 4 months ago
- I'm number 4 =) 5 months ago
An article by
