We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37226
    • 3 Posts
    Hello,

    I am working on a website where I am using multilanguage. So the website can be either dutch or english.
    Right now im running the website in xampp (localhost).

    When i start the website it will start at localhost/websitename/

    So the link to my css file there should be /style/style.css

    But the problem is, when i am using multilanguage the website will for example goto localhost/websitename/english/page.html

    This means that that current page will not be able to find the css file at /style/style.css, but at ../style/style.css

    My current solution is to place both hrefs in the html code.
    Example:

    <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" charset="utf-8" />
    <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" charset="utf-8" />

    If this was only the problem with the css file, it wouldn't be such a big problem. But I am using a lot more links to extern files in my html, and this would mean I have to duplicate all hrefs and make a / and ../ version. This doesnt seem like the right way to me, and I am wondering if anyone knows a way to fix this problem.

    Thanks in advance

    Alexander
      • 22840
      • 1,572 Posts
      Try adding the base href in the head section

      <base href="[[!++site_url]]">
        • 37226
        • 3 Posts
        Quote from: paulp at Feb 18, 2013, 03:15 PM
        Try adding the base href in the head section

        <base href="[[!++site_url]]">

        Thanks that worked with a small change. Instead of [[!++site_url]], i just put there http://localhost/websitename/

        Otherwise it will still take the whole site url as the default path, instead of only point at the base directory

        But thanks! Helped a lot!