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.
我正在使用 cakePHP。如何为以下条件编写重写规则。
http://www.example.com/pages/about_us
到
http://www.example.com/about
与contact_us 和其他页面类似。
应用程序/配置/routes.php
Router::connect('/about', array('controller' => 'pages', 'action' => 'display', 'about_us'));
您可以像这样使用 301 重定向:
Redirect 301 /about_us http://www.example.com/about