How to create absolute URL address for xhtml website

  1. #1
    Jen11 is offline Full Member

    Question How to create absolute URL address for xhtml website

    I am trying to link pages of an xhtml website to its homepage. As the files are in different folders to the homepage, the only way for this is to reference the sites homepage URL by using <a href="http://mysite/index/htm">. However when opened, the sites location in the address bar in the browser window does not start with http://www.mysite/index/htm" but a long path to its location in the document and settings folder on the C Drive of my computer. I would appreciate any advise on creating the URL to appear in the browser window.

    thanks
    Jen11
    Last edited by Jen11; 29-07-2008 at 07:01 AM.


  2. #2
    DevilsAdvocate is offline Elite Member
    When you say the files are in 'different folders' do you mean 'sub' folders or outside the root folder (the folder where the home page (index.htm) resides).

    Are you hand-coding or using an application to create the site?
    Last edited by DevilsAdvocate; 29-07-2008 at 09:23 AM.

  3. #3
    Jen11 is offline Full Member
    Hi,

    The files I am trying to link to the homepage are in the 'sub-folders' of the website. I am handcoding using xhtml.

    Jen11

  4. #4
    DevilsAdvocate is offline Elite Member
    Tackle the Web with $5.99 .COM's from Go Daddy!
    OK. Well, what you're doing should work. i.e.

    Code:
     
    <a href="http://www.mydomain.com/sub_folder/sites_page.htm>Linky</a>
    However, this will only work if you're actually testing/running this on the domain's server itself (i.e. you've uploaded the site to that domain) and not on your PC.

    Internal relative URLs can be tested locally, absolutes by their nature will only work in a live environment.

+ Reply to Thread