我有很棒的 php 但我想将它从显示变量更改为看起来像 dirs
例如:
example.com/?mode=page&page=15
至example.com/page/15
和
example.com/?mode=pic&picid=136
至example.com/pic/136
但是我只知道一种方法,例如:
RewriteRule ^(.*)$ index.php?mode=$1&page [R]
但这仅适用于一种情况,否则为404s
我尝试使用RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
以使整个路径通过。但是,这种方式似乎没有在我的页面中传递 CSS。
我特别迷茫...
这是我的 htaccess 文件
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
IndexIgnore *
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^css/styles\.css$
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]