Hello,
I recently migrated my site from live to localhost. When I hover the mouse over the "Home" page (as well as other pages), the URL in the status bar continues to show the same URL that it shows in the live environment (as do the other pages).
My localhost environment is as follows:
1. Host: localhost / Windows XP
Server: WAMP Server 2.1
Apache version: 2.2.17
MySql version: 5.5.8
PHP version: 5.3.5
Browser: Firefox 8.0.1
2. In settings.php, the variable $db_url is remmed out.
3. File .htaccess exists; and contains the lines
"Options +FollowSymLinks"
"DirectoryIndex index.php"
4. In httpd.conf file, removed the # in the line #LoadModule rewrite_module modules/mod_rewrite.so.
After displaying the landing page, when I try to log into the site on localhost, I get the 404 Not Found message - "The requested URL /homepage was not found on this server." And if I click on one of the site's links created earlier (that is, without attempting to log in), the system takes me to the live server.
Any guidance on how to resolve the problem will be highly appreciated.
Thanks in advance.
Note: I may add that I had attempted to install PathAuto in the localhost environment; but I had to uninstall it as it was creating problems. The problem of the path has come up ever since this attempt.
Comments
Site local with $base_url
Hi,
On my local site I have:
$base_url = 'http://localhost'; // NO trailing slash!What I do not understand is that "$db_url is remmed out"?
You have to tell where the databse is, isn't it?
On the live site was your
On the live site was your site hosted in a sub directory or in the root directory?
In the same level as
In the same level as httpdocs, so not in httpdocs.
But local I'v put it insite the htdocs of my xampp installation.
Location of site in localhost
Hello PvO,
The site in localhost is located under wamp/www folder.
Location of live site
Hi,
The live server is located in a sub-folder pointed to by the domain manager.
Mistake in variable name
Hello PvO,
Sorry for the oversight; I meant remming out the $base_url variable.
Clear cache..
After migrating your server and if you are certain that the base url value in your settings.php file is correct (that is if you installed in your server's root directory put $base_url='http://localhost' ) try to empty your caches..
If you can not navigate in localhost to find the link to empty your caches , edit the url by hand to reach your localhost's empty cache address..
base_url variable, clearing cache
Hello,
As suggested by you, I put the string 'http://localhost' in the $base_url variable of settings.php. I also cleared the cache in the Firefox Tools/Options/Privacy option. After exiting from Wamp Server and re-running it, I observe that
1. The URLs of the options in my menu links (such as Home) continue to be set to my live server: clicking on Home takes me to the live server.
2. The landing page appears without any aesthetics - all content is left-justified.
3. I am unable to log into the localhost environment: Trying to log into the site with administrator id gives 404 Not Found - "The requested URL /homepage was not found on this server."
4. When I rem out the $base_url variable in settings.php and re-run the site from localhost, the site comes up again. This time, I am already logged into the site with my admin id! The links that are created by default by Drupal continue to function correctly (that is, they point to the appropriate positions in localhost. But links created by me point to the live server site.
Any inputs / advice on this problem will be much appreciated. Perhaps there is some setting in MySql needs to be changed?
Sorry , but when I said clear
Sorry , but when I said clear the cache I meant the drupal cache (you will find this in admin/config/development/performance).
If your drupal root folder is also the root folder of your webserver then by typing
http://localhost/admin/config/development/performance should get you to the performance settings page which has the button to clear drupal caches..
If you installed drupal inside some other folder e.g. test then the above link should be
http://localhost/test/admin/config/development/performance
Also check that you have an .htaccess file in your drupal root folder (in linux it is a hidden fiile , so you'll have to show hidden files too) .
Clearing Drupal Cache
Hi,
As suggested by you, I cleared the cache for Drupal, keeping the rest of the settings in the performance section intact. Still, no joy.
Frustrated, I re-downloaded the material from the live server back to localhost, and after amending the settings in settings.php and renaming .htaccess to htaccess.txt, I find that in the new environment the path for homepage continues to point to the home page of live server. My question is: is this normal behavior?
Absolute path in one of my links
Just another shot:
I have a site which I copied to local. I've been using it this weeks and the menu's seemed all to work all right. But today I clicked on one of them and it pointed to the live site (happily I changed the colors of the local site!). It turned out I had an absolute path, so I changed in 'Menus' to a relative path.
Maybe there is some absolute path pointing to your live site.