22 Şubat 2009 Pazar

Htaccess ile Yönlendirme

Domain.com adresinize gelen ziyaretçileri domain.com/index.php ye yönlendirmek

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^$
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^$ http://domain.com/index.php [L,R=301]



Domain.com adresini www.domain.com adresine yönlendirmek

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]


www.domain.com adresini domain.com adresine yönlendirmek

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
{if $random eq 1} {else} {/if}


Kaynak : http://zrmbilisimseoyarismasi.blogspot.com