Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-includes/pomo/plural-forms.php on line 210

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-content/plugins/wordfence/models/block/wfBlock.php on line 552

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-content/plugins/wordfence/models/block/wfBlock.php on line 553

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-content/plugins/wordfence/models/block/wfBlock.php on line 555

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-content/plugins/wordfence/models/block/wfBlock.php on line 570

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /webroot/d/y/dynam038/primary/www/wp-content/plugins/wordfence/models/block/wfBlock.php on line 573
Canonical Redirects

Canonical Redirects

Here is some quick code to put into your .htaccess file. These kind of redirects are called “Canonical Redirects.”

Redirect non-www to www version

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

Redirect www to non-www version

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com [nocase]
RewriteRule ^(.*) http://example.com/$1 [last,redirect=301]

Pretty basic post but its pretty useful.

By: on Jul 16
Cateogry: Web
Tags: ,

Contact

We are ready to handle any of your web needs. Use the form below to contact us and we'll get back with you in a timely fashion.

If you would like to setup a meeting, we can come out to your place no matter where you are.

Name*

Email*

Message