当我把浏览器指向site.com/index.php/"non-existent-dir"网站时;显示


When i point my browser to website site.com/index.php/"non-existent-dir" shows index.php the page with no css

这是我的。htaccess文件:

ErrorDocument 404 /404.html
Options +FollowSymlinks
Options -Indexes

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www'.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

没有应用CSS样式

我不希望页面显示在所有…它不应该显示我配置的404页面吗?

index.php/不是目录

这是因为你没有为style/image href和src使用绝对路径。

<link rel="stylesheet" type="text/css" href="/design/style.css"/>
<img src="/design/mylogo.php"/>

您可以看到,我在路径前面添加了/,所以我指向浏览器在根位置搜索文件。当您访问url http://example.com/index.php/somename时,浏览器试图在此位置找到css/images http://example.com/index.php/somename/design/style.css或http://example.com/index.php/somenamde/design/mylogo.png.