打开caches\\configs\\system.php,修改html_root的值
默认在51行:

\'html_root\' => \'/html\',//生成静态文件路径

修改为:

\'html_root\' => \'\',//生成静态文件路径

将html_root这项值添加到后台的基本设置中,让管理员可以随时修改html_root的这个值
1.打开phpcms\\modules\\admin\\functions\\global.func.php
找到:

\'img_path\',\'attachment_stat\',

在后面添加:

\'html_root\',

修改好后保存.

2.打开phpcms\\modules\\admin\\templates\\setting.tpl.php
找到:

  <tr>
    <th width=\"120\"><?php echo L(\'setting_upload_url\')?></th>
    <td class=\"y-bg\"><input type=\"text\" class=\"input-text\" name=\"setconfig[upload_url]\" id=\"upload_url\" size=\"50\" value=\"<?php echo $upload_url?>\" /></td>
  </tr>

在其下面另起一行,加入以下代码:

   <tr>
    <th width=\"120\">生成静态文件路径</th>
    <td class=\"y-bg\"><input type=\"text\" class=\"input-text\" name=\"setconfig[html_root]\" id=\"html_root\" size=\"50\" value=\"<?php echo $html_root?>\" /> 注:默认在html目录下(即\"/html\"),要生成在网站根目录下留空即可</td>
  </tr>

修改好保存即可.

现在在后台的基本设置里面,已经可以修改这个值了

收藏 打印