How to rewrite URLs for all views in CakePHP?
I am new to CakePHP.
I want to rewrite all the view files with the .HTML extension to URLs.
Users should not be able to see the original URLs.
Example:
If 开发者_开发知识库I have
/controller/view/2 then it should be displayed in URL as
/controller/view.HTML only.
How can I do this?
You'd have to put in some rewrite rules on the web server. You can pass the parameters using POST variables (thereby eliminating the '2' in your example, as in /controller/views/) and then using mod_rewrite access the URL from view.html.
加载中,请稍侯......
精彩评论