none
Relative paths changed to absolute paths RRS feed

  • Question

  • Sorry, I've searched through the forum and couldn't find this answer even though I'm sure I've read it here.

    We've been asked to take over managing and adding content to an existing ASP website. 

    When I import the site using HTTP into an existing empty website I created (I know, I should Publish, but the client doesn't want to ask the current designer (who's jerking him around) for the password, so I can't use FTP and Publish), the links change from relative to absolute.

    <img style="MARGIN-BOTTOM:4px" src="/img/Hours.gif" originalAttribute="src" originalPath="/img/Hours.gif" width="74" height="20" alt="Hours" border="0">
    becomes 
    <img style="MARGIN-BOTTOM:4px" src=file:///H:/Work/CUTech/MCH/oldsite3/img/Hours.gif width="74" height="20" alt="Hours" border="0"> (H:/... is my local data drive, not a network share.)

    The path is now absolute, and the originalAttribute="src originalPath="/img/Hours.gif is gone.

    However,  <a class="Block" href="Facilities.aspx#Pool">Pool</a>  doesn't change (both pages are in the same folder).

    EW is set to manage the site using hidden metadata.

    So, I see 2 possibilities: It's either because I imported instead of published or it's an ASP thing (I'm not used to dealing with ASP). What can I do?

    I know some of you probably have a macro that will generate the response, since it's such a common topic, but I couldn't find anything while doing a search that addressed this exactly.

    Thanks, Bill
    Thursday, August 7, 2008 9:49 PM

Answers

  • You need to publish between locations Bill.
    Import quite often causes these type of issues as it doesn't move all of the files.

    When you publish between locations, EW updates the hidden metadata files
    as it moves them.

    Also it's best to create an empty web, set it to manage using hidden metadata, and then publish to the new empty web.


    FrontPage MVP
    Friday, August 8, 2008 12:53 AM
  • There is a bug in the Import Web Site Wizard that I have reported some time ago.

    The Import Web Site Wizard rewrites URLs when an imported page links to another imported page via an absolute URL. These URLs are rewritten by xWeb to URLs such as "file:///C:/linked-page.htm". xWeb is correct to rewrite these URLs. However, it should use relative URLs such as "linked-page.htm".

    xWeb does not support root-relative links such as "/img/Hours.gif", so I assume that this link is treated as an absolute URL.

    Friday, August 8, 2008 10:24 PM

All replies

  • I've experienced this too, and a solution that worked for me was to use the insert tools on the general tool bar within EW instead of "dragging into the site" from your HD files.  EW is very touchy and wants files imported using it's flavor of tools or it will use absolute references that won't follow into ftp publishing.  I hope this helps.
    Thursday, August 7, 2008 11:48 PM
  • No, that's not it. I didn't put any of those pictures in the pages. I imported the entire site and it changed in the import process.

    (and I never drag stuff into the site)
    Friday, August 8, 2008 12:32 AM
  • You need to publish between locations Bill.
    Import quite often causes these type of issues as it doesn't move all of the files.

    When you publish between locations, EW updates the hidden metadata files
    as it moves them.

    Also it's best to create an empty web, set it to manage using hidden metadata, and then publish to the new empty web.


    FrontPage MVP
    Friday, August 8, 2008 12:53 AM
  • That's what I was afraid of, Steve. I was sure it was the importing process (it's the first time I've used it instead of publish).  But because I don't work with ASP sites, I wasn't sure.

    Yeah, I created an empty website to hold it, but then I had to use import.

    I guess we'll have to bite the bullet and try to get the old webmaster to give us the FTP password.

    On the other hand, the site was done with Visual Studio .NET 7.1, yet it doesn't use ASP for anything but the contact form, and it has 271 errors when I validate it. The rest of it is such a mess (every page is made of nested tables for layout), that I may just start over. It's a small site.
    Friday, August 8, 2008 1:08 AM
  • <quote>
    I guess we'll have to bite the bullet and try to get the old webmaster to give us the FTP password.
    </quote>

    Aaah, that's even more of an issue if you weren't logged on.
    That means you only got the files that are visible to a regular site visitor.

    FrontPage MVP
    Friday, August 8, 2008 1:16 AM
  • There is a bug in the Import Web Site Wizard that I have reported some time ago.

    The Import Web Site Wizard rewrites URLs when an imported page links to another imported page via an absolute URL. These URLs are rewritten by xWeb to URLs such as "file:///C:/linked-page.htm". xWeb is correct to rewrite these URLs. However, it should use relative URLs such as "linked-page.htm".

    xWeb does not support root-relative links such as "/img/Hours.gif", so I assume that this link is treated as an absolute URL.

    Friday, August 8, 2008 10:24 PM
  • Christoph Schneegans said:

    There is a bug in the Import Web Site Wizard that I have reported some time ago.

    The Import Web Site Wizard rewrites URLs when an imported page links to another imported page via an absolute URL. These URLs are rewritten by xWeb to URLs such as "file:///C:/linked-page.htm". xWeb is correct to rewrite these URLs. However, it should use relative URLs such as "linked-page.htm".

    xWeb does not support root-relative links such as "/img/Hours.gif", so I assume that this link is treated as an absolute URL.

    This is not the first time I have seen this reported, so although I can't test it until my retail copy arrives, I presume that it is so (I have usually employed document-relative links prior to this point). Has it been bugged, and is there any response as to when it will be addressed? I mean, c'mon, this is pretty damned fundamental to the purpose of the technology.

    cheers,
    scott

    Saturday, August 9, 2008 3:36 AM