Redirecting to base URL not working

Permalink
Hi everyone...

I'm creating a website for a client and I need people to be able to access it with or without 'www' at the beginning.

I've tried '.htaccess' files and editing the config/site.php file.

I read the error log and apparently it has something to do with concrete5 core files (maybe from a wrong install)...

Anyway, this is what I see in the error log:
[Mon Jan 09 20:50:07 2012] [error] [client xxx.xx.xxx.x] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/user/public_html/concrete/libraries/request.php:51) in /home/user/public_html/concrete/libraries/view.php on line 841
[Mon Jan 09 20:50:07 2012] [error] [client xxx.xx.xxx.x] PHP Warning:  strpos() [<a href='function.strpos'>function.strpos</a>]: Empty delimiter in /home/user/public_html/concrete/libraries/request.php on line 51


The URL ishttp://www.manoscreativas.tk (works)
howeverhttp://manoscreativas.tk (doesn't, it just takes me to the default cgi 'thingy')

I'm NOT afraid to play around if I know what I'm doing... so any help is appreciated. Thanks!

NBardales
 
NBardales replied on at Permalink Reply
NBardales
One more thing, if I go tohttp://manoscreativas.tk/index.php... it DOES redirect me to the base URL (with www). What am I doing wrong?
hostco replied on at Permalink Reply
hostco
It seems maybe you were having a dns issue as your domain is now forcing to

http://www.manoscreativas.tk

even if you type

http://manoscreativas.tk

Try clearing your browser cache and refreshing the page.

You can not have both http://www.manoscreativas.tk and manoscreativas.tk resolve for your site.

As you can see in config.php

define('BASE_URL', 'http://www.yoursite.com');


You can set it with or without www. but not both
NBardales replied on at Permalink Reply
NBardales
I don't understand, because all my other domains work fine with or without 'www'. If I force the redirect to the base URL in site.php, all other options redirect.

This is the ONLY domain in which it doesn't work.
NBardales replied on at Permalink Reply
NBardales
It still isn't working... Anybody have an idea of what might be wrong?
jbx replied on at Permalink Reply
jbx
This appears to be working correctly...

If you goto eitherhttp://manoscreativas.tk orhttp://www.manoscreativas.tk it is redirecting you to your base_url ofhttp://www.manoscreativas.tk.

This is the correct behaviour for a site. If you have a site visible on 2 different domains (i.e. with and without the www.) then you can be downgraded by google for having duplicate content.

Your site will work with or without the www.. But the visitor will always see the www. in the address bar.

Does that make sense?

Jon
NBardales replied on at Permalink Reply
NBardales
Yeah, that makes sense. However, it wasn't doing that before...

I replaced the entire 'concrete' folder and it works now, so I guess there must've been something wrong with my core install.

Anyway, thank you all for your help.