Make links that start from root directory? how do I do it?

3 replies
  • WEB DESIGN
  • |
I want to use the same header file for multiple directories on my site, how can I make the links all work without using the domain in the links?

Is there a way to tell the link to start from the root directory?

Thanks!
#directory #links #make #root #start
  • Profile picture of the author ussher
    if your page is php then you can assign a variable to your url and use that site wide, but the most simple way is just leave out the url

    <a href="/path/to/your/file.html">link</a>
    Signature

    "Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."

    - jamroom.net
    Download Jamroom free: Download
    {{ DiscussionBoard.errors[3925019].message }}
    • Profile picture of the author andrejvasso
      Follow ussher´s advice and in case you need to "go back" one dir, you can do that like this:

      <a href="../file.html">link</a>
      {{ DiscussionBoard.errors[3925516].message }}
  • Profile picture of the author RedTailScream
    Just use:

    <a href="/filename.html</a>
    {{ DiscussionBoard.errors[3943195].message }}

Trending Topics