By saltcod on
My site(s) hinge on having www in the address bar -> ie:
http://www.example.com -> works
http://example.com -> doesn’t work
As per this thread, http://drupal.org/node/654552 I was having weird Page Load issues that I resolved by commending out the $base_url in settings.php.
The really weird part
The site works with or without the www in Firefox, but won’t work in chrome unless I put in the www
Most interestingly, while example.com doesn’t work in Chrome, sub.example.com does. IE: I don’t need the www in front of subdomains.
Is this a Chrome bug or a DNS issue? I’ve got a feeling it’s a DNS issue that’s been uncovered by Chrome.
Suggestions appreciated!
<strong> Info: </strong>
Latest versions of Drupal, php, mysql, apache, Linode VPS hosting, multisite setup.
Comments
.htaccess could be an option
you could try editing your .htaccess file...
(steps taken from Drupal 6 Search Engine Optimization)
hope that helps...
Hey Steve, thanks for that -
Hey Steve,
thanks for that - never would have thought of it. Any ideas about why I'm experiencing these issues with my VPS, but have never seen them when I was on shared hosting?
Do the shared hosting people 'take care' of a lot of config issues like this at the Apache end?
thanks again for the suggestion -when I try it out I'll let you know.
Sorry, I'm not really sure
Sorry, I'm not really sure why you would be experiencing this in a VPS setting, as opposed to a shared environment... I hope the edit does the trick though! :)
i don't get it. I'm having
i don't get it. I'm having the same issue and am having trouble finding what needs to be done. www.example.com DOESN'T work but http://example.com does.
I'd like both to work. what should I do?
site won't work when www is in browser address- figured out prob
The problem indeed lies within the .htaccess file. For complete noobs like me, this is a file that is invincible. that (.) in front of the file is what makes in that way. To edit, locate the file in your ftp window. Edit the name to not have the . in front of it. (change from .htaccess to htaccess).
drag file to your desktop. open in a text editor, dreamweaver, or what ever you use.
---------
To redirect to your site without the www. then just uncomment the couple of lines as shown below. Uncomment means to take the # sign away so these lines are read. (also... remember to replace the domain name (example.com) with your own), so it looks like this:
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# adapt and uncomment the following:
RewriteCond %{HTTP_HOST} ^www\.soflolaw\.com$ [NC]
RewriteRule ^(.*)$ http://soflolaw.com/$1 [L,R=301]
If you want the www. then only uncomment the other two lines above it,so it should look like this:
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
RewriteCond %{HTTP_HOST} ^soflolaw\.com$ [NC]
RewriteRule ^(.*)$ http://www.soflolaw.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.exmaple\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
Once you've made changes, upload file back to your ftp. Then rename the htaccess file to have the . in front again (.htaccess) It will override the current and should work immediately!
Hidden Files on Mac
If your on a Mac you might need to configure your machine to show hidden files. This is from another post on the topic:
"By default osx does't display hidden files. If you use a program like http://www.bresink.de/osx/TinkerTool.html you will be able to enable osx to show hidden files like .htacess. You can then copy the now visible htaccess file to your drupal install. At least that's why I couldn't get clean urls on mamp. Hopefully this helps."
There are other solutions, I can't remember which one I used but once you have addressed it, .htaccess will show in Dreamweaver or whatever else your using to edit it.
still not working
I have used 3 domains for my site which is multilingual. Its working in Mozilla but in IE and chrome it is not working without www. I have tried with the different changes in .htaccess files but unable to resolve this issue. Please suggest.