Hi,
I am trying to mirror a drupal site to a small server on our local network to be used as a test bed for future changes.
I have successfully copied all the files, and mirrored the database. The frontpage is loading correctly, however I am having problems with the links on the page.
At the very top of the page is our logo, and at the bottom are small textual links to pages (eg. contact us), these all point correctly to the test server the installation is running on. All other links on the page though, including the page content, primary and navigation menus, are pointing back to the domain name for our 'real' website. The result is that every time i click on a link on the page, including menus, i end up redirected back to our actual working site.
I have altered the $base_url parameter in /sites/default/settings.php but this has not fixed the issue.
Many thanks for any help.
Tatty.
Comments
Flush cache and run cron
Flush cache and run cron usually solve the problem.
Anyway, check if in the menus you put absolute urls, if yes change them to relative paths without trailing slashes
Musik shop
Studenti dell'Università di Macerata UniMc
Elicos
Thanks p4trizio, The problem
Thanks p4trizio,
The problem is that i cant flush the cache via the website as everytime i click on anything, including trying to log in, it simply redirects me to the proper website. I did some googling and manually cleared out cache_page and cache_filter to try to do this. Apparently the other cache tables are not affected by clearing the cache via the website, so i did not touch them.
The menus are all relative paths without trailing slashes already.
Clear all the tables
Clear all the tables beginning with "cache_"... I usually do that.
I did not unserstand exactly what u did with the db.. did you export it?
On the settings.php you set the $base_url: is it correct?
If everything is fine in your opinion, attach the html output of your page on local host, I'll try to give a look at that.
Patrizio
Musik shop
Studenti dell'Università di Macerata UniMc
Elicos
I have cleared all the cache_
I have cleared all the cache_ tables now, and it has not fixed the issue.
Yes essentially I just took a dump of the whole db and imported it to the local machine.
I have the settings.php set with: $base_url = 'http://192.168.0.112';
Is it ok to use an ip under the base_url? If you this all sounds ok to you then I will post the output in my next reply.
Yea.. I'd like to see the
Yea.. I'd like to see the output.
The thing is just that... u are achieving something I struggled for! I spent hours to get the same result u have now, but hacking core functions!
:)
Musik shop
Studenti dell'Università di Macerata UniMc
Elicos
Just a random question: did
Just a random question: did you modify the connection string? It's on the settings.php file, around line 92 ($db_url)
Musik shop
Studenti dell'Università di Macerata UniMc
Elicos
Wherever your *.tpl.php files
Wherever your *.tpl.php files are change any:
form action="/user"to
form action="<?php print base_path() ?>user"<link rel="stylesheet" media="screen" href="<?php print base_path() . path_to_theme() ?>/style.css" type="text/css" />Run and inspect static refs
/var/www/staging/themes/yoursite# grep \"/ *sites/default/settings.php - update $db_url & $base_url
$db_url = 'mysqli://dbuser:pass@localhost/dbname';$base_url = 'http://drupal-dev.localnet/staging';
.htaccess
update: RewriteBase /staging/ (when not rootpath)
Some of this can be backported to the site except the .htaccess and settings.php.
Check your /var/log/apache2/access.log and look for 404s too.
I couldn't succeed at the DB export/import for some reason, so phpMyAdmin worked:
1 Browse to database, click export
2 Export options that worked for me:
Export:
Select All
SQL
Options
Comments
SQL Compat: NONE
Structure
Add DROP...
Add IF NOT EXISTS...
Add AUTO_INCR...
Enclose table...
Data
Complete inserts
Extended inserts
Maximal Length: 50000
Use HEX for BLOB
Export Type: INSERT
Save as file
Import to new DB
Best of luck!