Web Hosting Talk







View Full Version : How to change links easily when moving a site???


WP1
08-25-2002, 08:36 PM
Hello!

Is there a way to change links easily when moving a web site from one webhost to another?

Thanks in advance for your responses.

WP1

iamdave
08-25-2002, 08:38 PM
Can you restate your question?

phpcoder
08-25-2002, 08:38 PM
Could you be more specific?

leoking
08-25-2002, 08:40 PM
what do you mean:confused:

eddy2099
08-25-2002, 08:48 PM
Originally posted by WP1
Hello!

Is there a way to change links easily when moving a web site from one webhost to another?

Thanks in advance for your responses.

WP1

Normally you would point the links within your site via relative links (eg /newpage.html) or even if you use static links pointing to your site with domain name (http://www.abc.com/newpage.html) . Once you do that and move the web site to a new host and transfer the name, you can keep the links as it is. There is no changes you need to make.

an41
08-26-2002, 12:19 PM
If links are not relative, you need to replace every instance of the initial webhost to the new webhost. If they are all static html pages, you could run some kind of script (like a perl script) to do the substitution.

TheGAME1264
08-27-2002, 12:58 AM
As eddy2099 pointed out, if the domain name itself isn't changing and you're merely moving the site from one host to another, you really don't have to change any links at all (e.g. http://www.a.com/b.html will be the exact same page on the new host as it is on the old one, once you upload your site). The only thing you have to change, as an41 pointed out, is any references to IP addresses and/or information specific to your old site and not your new one (e.g. a server path to a database link). Chances are, 90-95% of your content will not have to be changed. You're looking at a few minor adjustments here and there though, depending on the complexity of your site.

Reptilian Feline
08-27-2002, 02:50 AM
You can use some software like 1stpage2000 to do a search and replace on the linkpart that needs to be changed. You might also look into using relative links so you don't need to do the same thing next time.