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.
如何在 httaccess 中使用 AliasMatch 将这样的 url 传输example.com/userName 到此 url : example.com/user.php?name=userName。
example.com/userName
example.com/user.php?name=userName
您不需要使用别名。试试下面的代码:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ /user.php?name=$1 [L]