Generic .htaccess redirect non-www to www (apache)

I remember to have this note somewhere, but always lose it for some random reason.

So here you go :

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

Source : Stack Overflow

Share Button

Oleh Rinaldo Jonathan

Admin of this site. Artis papan PCB. #zoneRinaldo #Controllerism Studio Demon, Stage Angel, Sleepy Developer, Smoke free. Kalkud SHS 2012, PCR G15.

1 komentar

Tinggalkan Balasan

Verified by ExactMetrics