Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个看起来像的 URL
localhost/myapp/index.php?mod=user&page=createuser
我希望 URL 看起来像
localhost/user/createuser
如何使用 htaccess 文件执行此操作?
尝试这个
RewriteEngine on RewriteRule ^myapp/(.+)/(.*) myapp/index.php?mod=$1&page=$2 [L]
RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /myapp/index.php?mod=$1&page=$2 [L]