Which of the following experts will explain the principle of wordpress custom URLs?

Source: Internet
Author: User
Which of the following experts will explain the principle of wordpress custom url? I have observed that it is not implemented through. htaccess.
But how does it define the url at will, but the access is normal ??
An example is recommended.


Reply to discussion (solution)

I guess this will happen.
For example
Localhost/list. php/gonggao.html
When the program runs, execute list. php. The following gonggao.html is intercepted and used as an alias to query the id records in the database,
Then, what content is called?

This means that there is a route at the entrance to analyze the url, split it according to the slash, and then go to the database to check the alias, where to go

PATH_INFO
You don't even know this, do you?

PATH_INFO
You don't even know this, do you?


I have never used wordpress, but only rely on Path_info?
Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER['PATH_INFO'] would contain /some/stuff.

After trying rewrite, it seems that path_info is not available?
Besides, yii has a lot of code on the url.


I guess this will happen.
For example
Localhost/list. php/gonggao.html
When the program runs, execute list. php. The following gonggao.html is intercepted and used as an alias to query the id records in the database,
Then, what content is called?



This means that there is a route at the entrance to analyze the url, split it according to the slash, and then go to the database to check the alias, where to go



That is, it feels simple.
Follow

Thank you. I have implemented the function.
Http://demo.momocms.com/contents/jianjie.html

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.