Home > Linux, Open Source > Canonical Redirect .htaccess Apache2 für WordPress

Canonical Redirect .htaccess Apache2 für WordPress

Canonical Hostname Redirect (non-www to www):
This solution will redirect any page requested via a non-www domain to the same URL with the www domain, and as such it can be placed in the DocumentRoot of your site and will be enforced globally:

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

Apache2 rewrite guide
Apache2 htaccess Tutorial

Share
KategorienLinux, Open Source Tags: , ,
  1. Bisher keine Kommentare
  1. Bisher keine Trackbacks