开发者

Is http://localhost/index.php/controller/action?var=val valid?

开发者 https://www.devze.com 2023-03-29 13:01 出处:网络
Some PHP MVC has the index.php for the front controller. Now, my question is, putting a slash / and action after the document index.php makes it a valid URL? Also, does /action?var=val means that acti

Some PHP MVC has the index.php for the front controller. Now, my question is, putting a slash / and action after the document index.php makes it a valid URL? Also, does /action?var=val means that action is a file, 开发者_JS百科not a directory? I'm really confused if I'll follow such URL format.

Thanks in advance!


It is a valid URL. In fact, with URL rewriting, pretty much anything can be a valid URL.

People often use the index.php/controller/action fallback if they can't rewrite the URL. It still works and they can access the URL used within PHP to still process it.

0

精彩评论

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