htaccess 重写规则 - 不允许在 URL 中使用下划线 (_)


htaccess RewriteRule - Not allowing underscore (_) in URL

RewriteRule ^question/([a-zA-Z0-9_-?]+)/?([a-zA-Z0-9_-?]+)?$ question.php?postid=$1&url_title=$2 [L,QSA]

我尝试了所有正则表达式的下划线(_(,但这仍然不起作用。它向我展示了:

404 - Page Not Found错误

在目录内的 .htaccess 顶部尝试/q/规则:

Options -MultiViews
RewriteEngine On
RewriteRule ^question/(['w-]+)/([^/]+)/?$ question.php?postid=$1&url_title=$2 [L,QSA,NC]