Announcement

Collapse
No announcement yet.

Proper .htaccess setup?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Proper .htaccess setup?

    It looks like our site needs some work on our .htaccess file as we are having some canonicalization issues. I see some suggestions on the forum but I want to know if anyone has something better than this or will it do the trick?

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
    RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]
    Thanks!

    #2
    Hi there,
    Am I right in thinking you want to force the http:// in with the domain? Our usual problem with client sites is the non www domain issue in which we use:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.co.uk
    RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
    Regarding canonical links I have used the following link suggested here by Jonathan which has always seemed to work fine for us.
    Regards.

    Lee Jackson
    Creative Director

    Centurius Design & Marketing
    Centurius Website
    Portfolio of Work

    Comment

    Working...
    X