views:

336

answers:

3

Hey!

I am working on a drupal site which I checked out (svn) to my localhost.

Now the problem is that when I go to:

http://www.site.com

it all works fine, but when I go to:

http://localhost/work/site

I get redirected to

http://www.localhost.com/work/site

I have ran the install.php script and all works great. It reinstalls everything but when I go to the main site the redirect occurs.

I removed the .htaccess file, didn't do anything.

I am using windows 7 ultimate 64 (also tried on winxp pro 32) apache 2.2, php 5.2.13

Anyone know anyway to fix this?

Thanks

A: 

From the drupal sites/default/settings.php file:

/**
 * Base URL (optional).
 *
 * If you are experiencing issues with different site domains,
 * uncomment the Base URL statement below (remove the leading hash sign)
 * and fill in the absolute URL to your Drupal installation.
 *
 * You might also want to force users to use a given domain.
 * See the .htaccess file for more information.
 *
 * Examples:
 *   $base_url = 'http://www.example.com';
 *   $base_url = 'http://www.example.com:8888';
 *   $base_url = 'http://www.example.com/drupal';
 *   $base_url = 'https://www.example.com:8888/drupal';
 *
 * It is not allowed to have a trailing slash; Drupal will add it
 * for you.
 */
# $base_url = 'http://www.example.com';  // NO trailing slash!

Try setting $base_url = 'http://localhost/work/site';

matix
I have done this and I still get the same problem
AntonioCS
+2  A: 

Have you checked your window's hosts file? Not sure about where it lives in Windows 7, but in XP it lives here:

C:\WINDOWS\system32\drivers\etc\hosts

Make sure there is an entry like this:

127.0.0.1       localhost

As a double-check, you may want to flush your PCs DNS cache. Go into the command line and type:

ipconfig /flushdns
MatW
I have other websites working perfectly so this is not the problem
AntonioCS
How bizarre! If it's not this or an .htaccess / httpd.conf issue, then I have no idea what it could be...
MatW
A: 

I finally found the reason behind this huge problem.

It was the css and js optimization that was messing everything up. I set those two to off and then copied the database to the localhost version of the site and all worked out great!!!

AntonioCS