【发布时间】:2014-08-17 20:30:28
【问题描述】:
我在我的项目中使用 Clean-URL。为简单起见,我简化了代码。
我的 .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
我的 index.php:
<?php
require_once "/login.php";
?>
.css 文件包含在 login.php 的 HTML 部分中:
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
我的项目结构:
在根文件夹“test”中有 index.php、login.php 和 bootstrap 目录。
现在我的问题是:
如果我请求一个只有 1 个参数的 URL,例如
http://localhost/test/bla then all working!
但是如果我请求一个带有 2 个参数的 URL,例如:
http://localhost/test/bla/bla
然后显示登录页面,但没有所有 css 样式(不包括 css 文件...)。
但是为什么呢?
【问题讨论】:
标签: .htaccess mod-rewrite url-routing clean-urls