SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    If you are using Google Webmaster Tools free utility they have a specific section for changing website URLs:

    http://www.google.com/support/webmas...er=83105&hl=en



    .
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    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.




    .
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  5. #5
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sent you pm with location of file.

    Thanks a lot

  6. #6
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by dancing-mathilde View Post
    Sent you pm with location of file.

    Thanks a lot
    Corrupt file

    I send you my Gmail address.



    .
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,198
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Even a simple text editor usually has a find/replace feature.

  8. #8
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  9. #9
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    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.

  10. #10
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by dancing-mathilde View Post
    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?
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •