Redirecting to base URL not working

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] 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] 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 is (works)
however (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!

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

even if you type

Try clearing your browser cache and refreshing the page.

You can not have both and resolve for your site.

As you can see in config.php

define('BASE_URL', '');

You can set it with or without www. but not both
NBardales replied on at Permalink Reply
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
It still isn't working... Anybody have an idea of what might be wrong?
jbx replied on at Permalink Reply
This appears to be working correctly...

If you goto either or it is redirecting you to your base_url of

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?

NBardales replied on at Permalink Reply
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.