mod_rewrite 的正确语法?

Correct syntax for mod_rewrite?

在 Apache 2.4.7 .htaccess 文件中使用什么正确语法来获取

http://www.example.com/go/stuff

重写为:

http://www.example.com/index.php?tab=go&page=stuff?

我在 RewriteCondRewriteRule 指令中使用什么语法?

您可以在站点根目录 .htaccess 中尝试此规则:

RewriteEngine On

# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([\w-]+)/([\w-]+)/?$ index.php?tab=&page= [L,QSA]