开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜