Page 1 of 1
URL Migration, entries and htaccess
Posted: Tue Oct 23, 2007 11:57 pm
by bdconnolly
Is it possible to migrate all my entries to another url and keep all the links intact?
Can I (with help) direct Apache to direct
This:
http://first-domain.com/archives/articl ... _dogs.html
To this: http://new_domain.com/archives/article_about_dogs.html
?
Posted: Wed Oct 24, 2007 1:19 am
by chickens
If you do a SQL export from the old host to new you should be able to keep everything in tact.
Steps:
- use phpmyadmin to export the current database
Download the files from your current site via FTP
import the database onto the new server using phpmyadmin
Upload the files from your old server to new
Edit the serendipity_config_local.inc.php to match the new SQL settings as your mySQL information has likely changed
If you can access the admin panel newdomain/serendipity_admin.php then change the URL in the settings there. If not you will need to do it via phpmyadmin.
Test to make sure everything is working
report back any errors
Posted: Wed Oct 24, 2007 1:39 am
by bdconnolly
Right. thank you.
But I am more concerned with external links. I want htaccess to convert/redirect old links to new links.
See?
Posted: Wed Oct 24, 2007 1:44 am
by chickens
Oh, I understand what you want. You will need to do a 302 (or 301) redirect in the old servers htaccess. I am probably one of the least qualified people to help with this, so I am going to let someone else answer that.
Regex scares me.

Posted: Wed Oct 24, 2007 10:16 am
by garvinhicking
A script like this on the old host should do:
.htaccess:
redirect.php:
Code: Select all
<?php
header('HTTP/1.0 302');
header('Location: http://new-domain' . $_SERVER['REQUEST_URI']);
?>
Regards,
Garvin
301 vs 302
Posted: Wed Oct 24, 2007 3:22 pm
by mpking
Just as an FYI.
You might want to use Error Code 301 instead of 302.
301 is moved permanently
Your Web server thinks that your URL has been permanently redirected to another URL. The client system is expected to immediately retry the alternate URL.
302 is moved temporarily
Your Web server thinks that your URL has been temporarily redirected to another URL. The client system is expected to immediately retry the alternate URL.
The big difference is how google and other search engines treat the page.
301 - google will index the target url and its information
302 - google will index the original url, but with the target url's information. This is only true within the same domain. If the 302 is on a different domain than its target, then google will index the target url and the target url's information