www. and non-www. loading different versions

Permalink 1 user found helpful
I have a site that is loading a different version of the pages based on whether I use www. or dont use www.

The site is:


The www site is loading old versions of the pages.

How do I fix this?

It is hosted on godaddy. I called them, and they think it is an issue with concrete5 settings.

(note, I tried searching forums, but could not find anything about this)

View Replies:
SuperNova replied on at Permalink Reply 1 Attachment
I don't see a difference in my browser.
May you clear the cache...
dkchapuis replied on at Permalink Reply
Thanks for looking. I should have mentioned the the www. version has an old link at the bottom of the page and is missing some "PayPal" text.

It isn't a user-side problem. I see it on 4 different computers.

(note - on phone at moment - will post pic showing diffference later)
mhawke replied on at Permalink Reply
I think you should speak with your host about this. I ran both URL's through Pingdom's DNS Health test and the URL containing 'www' reports errors in the way it's set up. The URL without 'www' does not report errors.

mhawke replied on at Permalink Reply
If you need to, you can add some lines to the .htaccess file (in the root of your domain) that will re-write any url's that contain 'www'.

Found this snippet here:


Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L]

Danica's the only good thing about GoDaddy as far as I'm concerned.
dkchapuis replied on at Permalink Reply
Does concrete5 automatically create an htaccess file, because I am not seeing one.

And I am not too fond of godaddy, but it has been better than the other two hosts I tried. Do you have a host you recommend for somebody using multiple sites?
mhawke replied on at Permalink Reply
Using an FTP program like Filezilla, have a look in the root folder for your site. If there isn't an .htaccess file, you can make on and add the code to it.

Try something first... if you go to 'Dashboard->System and Settings->Pretty URL's' and try to enable Pretty URL's, does it give you a message that C5 WAS able to update your .htaccess?
dkchapuis replied on at Permalink Reply
That built the htaccess file, and adding the code you provided is doing the rewrite - thanks.

Still interested to hear of a better hosting company.

mhawke replied on at Permalink Reply
Well I'm with TMD Hosting and I'm fairly happy with them considering I only pay $3.85/month. They have the same issues that all shared hosting plans have trying to balance performance with cost but generally they resolve problems quickly and tech support isn't too condescending, at least not yet.

They have a 'Thanksgiving Special' on for the next 3 hours for $2.85/month. One year costs $35. Might be worth getting a 'sandbox' account with them just to test them out to see how you like it.
imeos replied on at Permalink Reply
Had the same, strange problem. Fixed it by rerouting all request fromhttp://www.mydomain.com to mydomain.com (without the trailing 'www').

Btw.: You can configure your (Apache) webserver for that, by adding this to your .htaccess:
# Option 1:
# 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]
# Option 2:
# Rewrite "domain.com ->http://www.domain.com" 
<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
  RewriteCond %{HTTP_HOST} (.+)$ [NC]
  RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
mhawke replied on at Permalink Reply
That's what my code does above but uses wildcards so the .htaccess file is portable. It worked to solve the problem.
WebSolutions replied on at Permalink Reply
I think the bigger problem here is that the page contents are displayed according to their URL - this is definitely a problem and likely the reason it never was an issue before v5.5 is because in site.php the BASE_URL was always in there, whereas now it doesn't put it in there with a normal install.

This issue has caused me a tonne of grief. I was hoping that someone from the core team would have recognized it and provided more info but this is the most elaborate post on the topic I have found.
Adreco replied on at Permalink Reply
Just dealt with a similar headache :(
Fixed (for now) by shutting off all settings in cache - clearing, and turning back on.
I suspect it started appearing as an issue when I'd do edits logged intohttp://mysite.com but my client logged intohttp://www.mysite.com and they may have cached as different site pages?
jlines41 replied on at Permalink Reply
+1 on on clearing cache.

I am using Concrete 5.6 and I was having the same issue.

From your 'Dashboard' go to 'System and Settings'

Under 'Optimization' select 'Clear Cache'
mouisa replied on at Permalink Reply
Thanks this one works fine !!
Atreu replied on at Permalink Reply
+1 again on the clearing cache within C5. Thanks!
Atreu replied on at Permalink Reply
+1 again for clearing the cache within C5. Thanks!
MAKG replied on at Permalink Reply
When editing css for blocks in packages the change applies only to non www addresses even though my site's domain was entered with www on install. I try changing css in both 'public_html' and 'www' on the hosting server and manually cleared the cache - still css loads from the old one.
When I remove the css completely the page loads without it but when it's put back in (updated) it still loads the old version - this is very strange and makes no sense.
I'll try putting an overwrite in the blocks dir next.. will see
MAKG replied on at Permalink Reply
OK, creating a template for a package in blocks works the first time but then when changes are done to the css in that theme concrete would still load its first css version. The only way I can have changes applied is to copy a block theme, give it a new name and then apply the new one to my block when in page edit. Clearing the cache in my browsers and in c5 doesn't help, it's like there is another cache somewhere that concrete looks into first ignoring the rest.
MAKG replied on at Permalink Reply
Created a copy of my site with xampp - there's no problems with updating concrete blocks css on local, it must be my hosting provider then. Recently started the cloud backup thing - must be caching it there...