Hi everybody,

I have tested Drupal for a few weeks in a localhost installation (with EasyPHP) and two weeks ago I finally launched my Drupal-based website. To do this, I used the Drupal "module" in the Fantastico Pack on my web hosting.

But the problem is that the website works with the default URL "http://mysite.com". I don't know why. I insist to use "http://www.mysite.com", but because of that, I'm regularly redirected to "http://mysite.com" (when editing or posting a node, or when I just do something in Drupal). It is very obstructing for me and I don't know how I can fix this problem. I added a little code to my .htaccess file to permanently redirect http://mysite.com/* to http://www.mysite.com/*, but I think that all the queries are executed in http://mysite.com. And I don't want this.

I don't know if this problem is related to Drupal or my hosting, so I'm asking this question to you guys. Do you know where I can define the URL with the WWW as default?

Thank you very much, and, again, excuse my bad english :)

Squill'

Comments

sepeck’s picture

settings.php
look for $base_url

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Squillace’s picture

Hi...

Thanks but it doesn't worked. The entry was effectively http://mysite.com but I added the WWW and the problem still the same (an exemple: I open www.mysite.com, edit the frontpage node, and when I submit the modifications, I am redirected to http://mysite.com).

:(

bgilday’s picture

I just ran into this exact same problem today. I moved my first sandbox site to public_html, but the www got blown away whenever I submitted a form.

I went to /public_html/sites/default/settings.php and made the following change to the file that fixed the problem:

Changed from 'http://yoursite.com'; // NO trailing slash!

TO 'http://www.yoursite.com'; // NO trailing slash!

This fixed it for me completely.

Brian Gilday
Municode
www.municode.com

Squillace’s picture

Well... it doesn't worked for me. :-/

Squillace’s picture

Damn... I just saw that the problem is a little bit bigger. :-/
I make the URL modification in the settings.php file, I upload it... then I download and open it again, and the URL is http://mysite.com again. The modification don't remain. :(

Where is the problem?

Thanks guys.

bgilday’s picture

Delete the settings.php file from your site first, before trying to upload the modified version. This should ensure the changes stick.

Brian Gilday
Municode
www.municode.com

Squillace’s picture

Thank you, Shifthappens. I think it worked... I removed the redirect thing in the .htaccess file and I uploaded this "new" settings.php. Seems working.

Thanks a lot ;-)

Squill'