在PHP MVC项目中引入.htaccess文件
我最近开始研究mvc。我的问题是css文件的识别。 当我添加行时在PHP MVC项目中引入.htaccess文件,php,css,.htaccess,Php,Css,.htaccess,我最近开始研究mvc。我的问题是css文件的识别。 当我添加行时 RewriteRule ^([^\/]*)/([^\/]*)$ index.php?page=$1&id=$2 [L,QSA] 对于.htaccess文件,另一个css文件不知道。但是什么时候改成 RewriteRule ^(.*)$ index.php?page=$1 [L,QSA] 它很好用 这是我的.htaccess文件的详细信息 RewriteEngine on RewriteCond %{REQUES
RewriteRule ^([^\/]*)/([^\/]*)$ index.php?page=$1&id=$2 [L,QSA]
对于.htaccess文件,另一个css文件不知道。但是什么时候改成
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
它很好用
这是我的.htaccess文件的详细信息
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(css|pdf|gif|ico|jpg|js|png|swf|pdf|txt|php)$
RewriteRule ^([^\/]*)/([^\/]*)$ index.php?page=$1&id=$2 [L,QSA]
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
我能做些什么来解决这个问题试试这个
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?url=$1[PT,L]
它工作正常,但我想在地址方向上使用2步。喜欢sample.com/page/12并使用此模式。