Is http://localhost/index.php/controller/action?var=val valid?
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.
精彩评论