我有这个网址:
http://domain.com/index.php?type=item&id=656&title=mytitle
Kow我想在.htaccess中将此网址重写为:
http://domain.com/item/656/mytitle
我在.htaccess中使用了这个ruls:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?type=$1&id=$2&title=$3 [L]
虽然css
中的js
和index.php
个文件无法正常工作,但已有效
我的css文件链接
<link rel="stylesheet" type="text/css" href="file/css/style.css" />
答案 0 :(得分:1)
了解RewriteCond
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
# Then...
RewriteRule ...
或
# If the uri not starts with ...
RewriteCond %{REQUEST_URI} !^/file/css
# Then...
RewriteRule ...