Changing http links in different address

Hello (again after a long long time).

Not sure if my posting is in the right forum, but hope you can move it, and help me with following:

On my site I have links to: www.mysite.com/file/file
Now I change the pages to a new addres, but in the html of pages are links to the old location (http://www.siteold.com/file/etc). Now I search a tool to rename the http://www.siteold.com/file/etc into http://www.sitenew.com/file/etc!

What is a tool to type old = … and new = … enter, and all is changing?

Thanks for the tips.

Dancing mathilde

If you are using Google Webmaster Tools free utility they have a specific section for changing website URLs:

http://www.google.com/support/webmasters/bin/answer.py?answer=83105&hl=en

.

Hi John,
Thanks for your reply. Think I have to be more specific.

In my html documents are links to files on the domain server, example:
<code>
<html>
<header>
</header>
<body>
text with link to files i.e. http://www.domainold.com/folder/folder/file.
http://www.domainold.com/folder/folder/file1
http://www.domainold.com/folder/folder/file2
http://www.domainold.com/folder/folder/file3
http://www.domainold.com/folder/folder/file4
etc
</body>
</html>
</code>

On a page are several of these links and when changing all the links on all the pages it will be some long long work.

I do search a tool which can do this work. A tool where I can tell:
change áll ‘www.domainold.com’ into www.domain-new.com, so that result is:

<code>
<html>
<header>
</header>
<body>
text with link to files i.e. http://www.domain-new.com/folder/folder/file.
http://www.domain-new.com/folder/folder/file1
http://www.domain-new.com/folder/folder/file2
http://www.domain-new.com/folder/folder/file3
http://www.domain-new.com/folder/folder/file4
etc
</body>
</html>
</code>

Anyway thanks for the info about the step I also have to take for Google.

Mathilde

I use quite a good text editor that can globally replace the old URLs with the new URLs. Zip the files, send me the link to download the zip file and I will do the changes and forward them to you.

.

Sent you pm with location of file.

Thanks a lot

Corrupt file :frowning:

I send you my Gmail address.

.

Even a simple text editor usually has a find/replace feature.

If only the domain is changing, and the paths within the domains remain the same, use Ralph’s suggestion. A search and replace like this:

replace “http://old-domain.com” with “http://new-domain.com” will do the job.

If you want all mentions of the old domain changed, leave off the “http://”.

A good editor will hi-lite the found instances, let you inspect to be sure nothing went wrong, let you test a single instance, and then if all is copacetic, do a global replace (or some other action).

cheers,

gary

Yes, either use a “Search and Replace” or a ‘regular expression’ to do a site-wide or text/folder change within the code. Like as mentioned many good Editors can do this and another free open source example is; Notepad++

Furthermore you may want to later use - if on *nix - the .htacess to redirect from old style file/directory locations so that visitors don’t end-up on dead-end islands.

The safest thing to do (if you are on Apache) is to use mod_rewrite, which (as you might guess from the name) rewrites URLs from one form to another as and when people request pages from the server. This ensures that anyone visiting your site using an old URL will get to the right page - whether that’s from a link on your own site, a link on someone else’s site, a search engine that hasn’t updated its index, or an out-of-date bookmark.

Whenever you change the URL of a page, whether it’s one page being moved, a website being restructured, or the whole site being moved en masse to another domain - you should always use mod_rewrite or a 301 redirect to ensure that anyone going to the old URL gets taken to the correct page without needing to take any action.