![](/img/trans.png)
[英]Is there a way to create a friendly url like site.com/state/127 and still point to a particular file like index.php
[英]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]
我不希望页面显示...是不是应该显示我配置的te 404页面?
index.php /不是目录
这是因为你没有为你的style / image href和src使用绝对路径。
<link rel="stylesheet" type="text/css" href="/design/style.css"/>
<img src="/design/mylogo.php"/>
正如您所看到的,我已添加/在路径前面,因此我指向浏览器以在根位置搜索文件。 当你在网址http://example.com/index.php/somename浏览器试图在这个位置找到CSS /图像http://example.com/index.php/somename/design/style.css或http ://example.com/index.php/somenamde/design/mylogo.png 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.