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 映射到同名的控制器。我只想使用一个变量,这样我的配置文件就不会变得混乱。我试过这个:
location ^~ /$1 { rewrite ^ /controllers/$1.php last; }
但这似乎不起作用。有任何想法吗?
它应该是
location / { rewrite ^(.*)$ /controllers/$1.php last; }
如文档所示