我希望我的 URL 看起来像这样:
https://example-test.example.com/example-application_1.1/index.php?page=pagename&action=actionname
但是用户应该只输入:
https://example-test.example.com/example-application_1.1/pagename/actionname/
是否可以使用 .htaccess 中的 RewriteRule 来运行它?我想不通。
我的 .htaccess 文件现在看起来像这样:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^example-test\.example\.com
RewriteRule ^example-application_1\.1/([^/]+)/([^/]+)/?$ /example-application_1\.1/index.php?page=$1&action=$2 [QSA,L]