0

I have one root folder called GASS where I put all my php files and other related folders (templates,images,js,fonts,css)inside. When i try to run my project in localhost, http://localhost/GASS/alarm_A16GSM.php everything went smoothly. I wanted to change the URL to be more specific, http://localhost/GASS/alarmsystem/16zone/A16/overview.php thus i rename the php file and put it inside folders.

  • GASS
    • alarm-system
      • 16-zone
        • A16
          • overview

However when i try to run the new URL,the page shows error.

Code for the first URL where the page load successfully.

 <div class="overview"><a href="alarm_A16GSM.php" id="overview-selected"><span>

Code for the new URL where the page shows error.

<a href="alarm-system/16-zone/A16/overview.php" id="overview-selected">

This is the error message:

Warning: include(templates/header.php): failed to open stream: No such file or directory in .....

How am i going to load the page successfully using the new URL? How am i going to traverse four levels up to the root directory so that the page load successfully? Why i cannot directly call the php file using the(alarm-system/16-zone/A16/overview.php) path?

p/s: sorry for my bad English.

4

1 回答 1

0

看来您必须更新所有相对 url 以适应新的 url 结构。

检查你的,

<link rel="stylesheet" href="css/style.css">

 <script src="js/main.js"></script>

有时尝试使用/css/style.csscss/style.css可能会解决问题。

更新

根据新的 URL 结构也更改您的链接

<a href="alarm-system/16-zone/A16/overview.php" id="overview-selected">
于 2013-10-18T02:46:07.107 回答