Ez egy Kecs.es blog webfejlesztési ötletek, tanácsok, észrevételek

16feb/100

Főoldal és az index duplikátumok problematikája

Ugye SEO szempontból felmerül az a gond, hogy ugyan az a tartalom érhető el a www.domian.hu és a www.domain.hu/index.php tartalom alatt. Tehát duplikátum. A megoldás lehet a canonical használata, de szerintem sokkal elegánsabb megoldás, ha .htaccess segítségével védjük ezt ki.

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.(html?|php|asp|cfm)\ HTTP/
RewriteRule ^(.*)index\.(html?|php|asp|cfm)$ $1 [R=301,L]

Eredménye:

http://www.domain.hu/ http://www.domain.hu/
http://www.domain.hu/index.htm http://www.domain.hu/
http://www.domain.hu/index.html http://www.domain.hu/
http://www.domain.hu/index.php http://www.domain.hu/
http://www.domain.hu/index.asp http://www.domain.hu/
http://www.domain.hu/index.cfm http://www.domain.hu/
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.