如何设置.htaccess中查询字符串的默认值


how to set default value of query string in .htaccess?

我想用index.php设置overridable default query string

example.php/1

I tried

RewriteRule ^([^/]+)/([0-9]+)/?$ index.php?p=1

但没有成功。谁能帮我解决这个问题?

我想你要:

RewriteRule ^(.*)$ index.php?p=$1 [L]

这是你的答案:

RewriteRule ^([0-9]+)/?$ 'index.php?p=1