Missing CSS file and images after URL rewrite

后端 未结 3 1780
梦毁少年i
梦毁少年i 2020-12-05 11:46

I\'m trying to make user friendly URL using mode rewrite. My problem is, that after giving category like \'name\' to my URL, when I call the page using new URL, it can\'t lo

相关标签:
3条回答
  • 2020-12-05 12:21

    For your local version add

    <base href="//localhost/mywebsite" />
    

    to the head section

    and for your live versions change it to

    <base href="//your.domain.here" />
    

    reference at http://www.w3.org/TR/html4/struct/links.html#h-12.4

    0 讨论(0)
  • 2020-12-05 12:35

    you have to define the base path or the server view path in the connection.php and whenever u want that path, make that global. then that variable will b called and the css or images will take the whole path.

    for example $SVP="http://www.example.com/"

    global $SVP; echo $SVP;

    so

    0 讨论(0)
  • 2020-12-05 12:37

    Insert an image into the same file with the same relative path as the css href link, load the page in a browser, right-click the image in internet explorer, click properties and you should see where the relative path actually points to.

    0 讨论(0)
提交回复
热议问题