subdomain index.html: how to use files from the root domain (relative path)

Discussion in 'HTML & Website Design' started by XtremXpert, Mar 12, 2012.

  1. #1
    I have an html5 website on the host and I created a subdomain en.domain.com for the english version. I want to use the same index.html, services.html files but I don't want to duplicate the whole website on this subdomain or to add "../" to all url-s on these html pages.
    I remember a tag or something that I was using in the past to specify the relative path "../" or "../example/" in the <head> but I can't remember how exactly I was doing it.
    Can anyone point me in the right direction?
     
    Solved! View solution.
    XtremXpert, Mar 12, 2012 IP
  2. #2
    first of all you want to forget relative URLs, use fixed /image/bob.jpg style instead. Then, on the subdomain simply set a <base href="//domain.com"> and all the links will automatically point to the files on the primary domain.

    alternatively, take the time to use full URLs everywhere, http://domain.com/image/bob.jpg and then never have to worry again.

    Really though, loose the relative ../ URLs
     
    blacknet, Mar 12, 2012 IP