mod_rewrite index.php?p = $ 1

时间:2009-07-22 22:21:58

标签: apache mod-rewrite

我正在尝试将index.php?p = page重写为/ page /但是我无法让它工作!

这不起作用:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php?p=$1 [PT,L]

请帮忙!

1 个答案:

答案 0 :(得分:2)

反向引用$1RewriteRule的左侧组不对应(组使用parantheses定义)。请尝试以下方法之一:

RewriteRule .* index.php?p=$0

# - or -

RewriteRule ^(.*)$ index.php?p=$1
相关问题