How can I rewrite a url better? -Php Tutorial

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.