Dobrev.EU Blog

Things I want to share

Redirect Non-www to www.domain.tld in Apache

| Comments

If you wonder how to redirect your requests to your non-www domain back to www.domain.tld, here is how to achieve it using Apache with mod_rewrite active.

1
2
3
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.dobrev.eu
RewriteRule (.*) http://www.blog.dobrev.eu/$1 [R=301,L]

Comments