How can I optimize the url rules for phpcmsv9? -PHP development

Source: Internet
Author: User
By default, the URL path of the phpcmsv9 article is dynamic, and a lot of strings are not only ugly, but not conducive to search engine crawling, now I want to optimize the previous many URL characters into short and relatively easy URLs to be crawled by search engines. By default, the URL path of phpcms v9 is dynamic, for example

http://localhost/phpcms/index.php?m=content&c=index&a=show&catid=6&id=1

A large number of strings are not only ugly, but are not conducive to search engine crawling.


Now I want to optimize the previous many URL characters to be brief and relatively easy to crawl by search engines:

http://localhost/phpcms/news/1.html


The following three steps are involved.


Custom url rules

First, you must establish your own URL rules and understand some definitions and variable meanings. First, go to URL rule management: "extension"-"RUL rule management"-"manage RUL rules" and add rules ,:



The following is the definition of the RUL rule variable. Understanding it can help us define the rule well:

1. {$ parentdir} {$ catdir} --- meaning: The Directory Name of the current topic;

2. {$ catid} ---- meaning: column ID;

3. {$ year} ---- meaning: year;

4. {$ month} -- meaning: month;

5. {$ day} ----- meaning: day;


Modify "generate HTML Settings"

Find content> content Settings> management topic> and open the page:

Note that the English directory above is changed to "news ". Open "generate HTML Settings ",


In the content page, select "catdir/custom 2.html" from the URL rule drop-down box, which is the previously customized URL rule. Set other options as shown in the figure below.


Update Cache

The URL setting rules have been completed before, but do not forget to update the cache.

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.