我想重写链接,例如
index.php?page=entry&id=15&action=edit
到 entry/15/edit
。
这就是我的 .htaccess 现在的样子:
# Turn the Rewrite engine on
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite rules
RewriteRule ^([^/]*)(/([^/]*)/?)([^/]*)?$ index.php?page=$1&id=$2&action=$3 [QSA,L]
给我 404。
有什么问题吗?
最佳答案
括号太多。您可能感染了 Lisp。
尝试:
RewriteRule ^([^/]*)/([^/]*)/?([^/]*)?$ index.php?page=$1&id=$2&action=$3 [QSA,L]
关于apache - mod_rewrite 给我 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/538097/