1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create absolute URL address for xhtml website

Discussion in 'Web Development Help' started by Jen11, Jul 29, 2008.

  1. Jen11

    Jen11 Techie7 New Member

    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: Jul 29, 2008
  2. DevilsAdvocate

    DevilsAdvocate Techie7 New 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: Jul 29, 2008
  3. Jen11

    Jen11 Techie7 New 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. DevilsAdvocate

    DevilsAdvocate Techie7 New Member

    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.