0

Assets isn't indexing and showing thumbnails or uploading if I'm logged in to CP with www…

I've read elsewhere that www.example.com and http://example.com are treated as separate domains but is there a simple solution? I have all paths in EE set without www. including the CP url and I'm not forcing either with .htaccess

I can remember to login without www. but cant expect my clients to remember.

1 Answer 1

2

I would always say to stick to one or the other, either www or no-www. You're correct in that they are treated as separate domains and you may see a hit in terms of SEO if you have duplicate content on two different domains. Ideally you should always pick one and stick to it and ensure it's adhered to by backing it up in the .htaccess file:

Rewrite "www.domain.com -> domain.com"

<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>

This takes any requests for the www. domain and then forwards it on to the no-www domain giving it a 301 redirect (permanent move). This will ensure you and your clients don't accidentally use a both.

2
  • The different domain scenario is not just bad for SEO, but is a JS security issue; you can't cross-reference JS between domains or you open up a host of security holes. That's what makes Assets fail in this example, and I wanted to add that explanation to your awesome answer. :)
    – Lisa
    Apr 11, 2013 at 16:29
  • Hey Lisa. I was hoping you'd chime in with the Assets specific answer as I wasn't exactly sure how it would be having an impact. That makes perfect sense and backs up the overall answer to make sure you pick a side of the fence and stick to it. :)
    – Ian Young
    Apr 11, 2013 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.