How can I rewrite a url better? 1. all requests are received by the index. php file, and then the url is analyzed for corresponding operations.
2. use the rewrite function of the server to write corresponding rules for different URLs.
Which one is better?
Reply to discussion (solution)
1. I personally think MVC INFO 2nd cannot be implemented if the URL is used.
1. I personally think MVC INFO 2nd cannot be implemented if the URL is used.
The above is too fast to reply and an error is pushed!
1st better. the Current PHP framework supports the INFOPATH mode.
If there are more than 2nd URLs, you don't need to use them. if you want to pagination, pass parameters, etc.
The above is my opinion, newbie
Apache is always easier to work.
When I first saw this problem, I suddenly thought of zendframwork. zendframwork seems to have been used. To be careful, I downloaded and checked the zendframwork principle analysis (uml sequence diagram) of Han Shunping's zendframwork notes from the internet. I found that this is the same thing. when users enter the website url, the rewrite mechanism of the apache server forwards the http request to the index. php, index. php uses the reflection mechanism to call different controllers based on the requested domain name address. In this case, it should be better to adopt the first method.
The configuration is powerful enough. apache is usually handed over to php for processing ..
When I first saw this problem, I suddenly thought of zendframwork. zendframwork seems to have been used. To be careful, I downloaded and checked the zendframwork principle analysis (uml sequence diagram) of Han Shunping's zendframwork notes from the internet. I found that this is the same thing. when users enter the website url, the rewrite mechanism of the apache server forwards the http request to the index. php, index. php ......
This problem occurs only when I learn zend-framework.