我正在我的网站上工作,并使用 .htaccess 文件制作了“SEO url”。所以 taht website.eu/contact 等于 website.eu/index.php?file=contact。和 website.eu/case/somthing 等于 website.eu/index.php?file=case&ID=somthing。现在我的问题是,如果地址是 website.eu/contact/ 样式将不会被加载。
访问:
RewriteEngine On
RewriteOptions inherit
Options +FollowSymlinks
Options -Multiviews
RewriteBase /habberdesign
## hide .php extension
## To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ /index.php?file=$2.php&ID=$3
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /index.php?file=$2.php&ID=$3
ErrorDocument 404 /index.php?file=404.php
RewriteRule ^countdown /countdown
款式:
<link href="Styles/contact.css" media="screen" rel="stylesheet" type="text/css">