Pseudo-static ThinkPHP configuration

Source: Internet
Author: User
You can also configure any other suffixes in parameter configuration. Note that the suffix settings include. symbols. URL pseudo-static

ThinkPHP supports pseudo-static URL settings, and you can set the desired URL suffix. Edit the project configuration file Conf/config. php and set
The URL_HTML_SUFFIX parameter configuration is as follows:

'URL _ HTML_SUFFIX '=> '.shtml ',

Delete
Runtime
After the project cache file under the Directory takes effect, access the following address in the browser, the effect is the same:

Http: // 127.0.0.1/html/myapp/index. php/Index/index
Http: // 127.0.0.1/html/myapp/index. php/Index/index.shtml

If you have hidden
Index. php, the address is changed:

Http: // 127.0.0.1/html/myapp/Index/index.shtml

Now this
The URL has more static features and SEO effects, but the execution effect is the same as before.

In parameter configuration, you can also configure any other suffixes. Note that the suffix settings include.
Symbol.

We recommend that you use the U method to automatically generate URLs in the template to keep URLs consistent. For more information, see ThinkPHP
The U method automatically generates the URL.
Prompt

ThinkPHP pseudo-static is easy to misunderstand: After the pseudo-static configuration is completed, the system will automatically generate a file such as xxx.shtml.
Such websites. This is not the case. as mentioned above, after pseudo-static configuration, whether there is a. shtml or. HTML suffix or a URL without a suffix
The access effect is the same.

Therefore, to use pseudo-static, you can only manually add a static suffix or use the ThinkPHP U method to automatically generate a URL address with a suffix. We recommend that you use
U method to automatically generate a URL with a pseudo static address.

Read more

ThinkPHP system configuration

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.