[英]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.