PHP: about pseudo-static! New PHP users have been entangled in pseudo-static resources over the past few days. I have found a lot of information on the internet in this regard, and I have mentioned using ApacheRewrite. htaccess can be implemented. I have tried a few programs, but it can be implemented. but what's puzzled is that if a website does not consider pseudo-static at the beginning of construction, so after building a website, use PHP to address the pseudo-static problem!
New PHP users have been entangled in pseudo-static resources over the past few days. I have found a lot of information on the internet in this regard, and I have said that Apache Rewrite is used. htaccess can be implemented. I have tried a few programs, but it can be implemented. but what's puzzled is that if a website does not consider pseudo-static at the beginning of construction, after the website is built, can I use the above method to set it? There are many problems related to links on the page (non-pseudo-static links), such as passing parameters on a paging program, previous pages, and next pages, what should I do with links in the program, modify them one by one, format them, and there is no clue ..... What is the complete process of pseudo-static website implementation? Do you want to modify the program?
------ Solution --------------------
It is better to have a function/class method to control the link format.
------ Solution --------------------
Here is an example. RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ /? Jourindex. php? Id = (. *) & path = (. *) & page = (. *) $ default_$$$2.html? Page = $3
------ Solution --------------------
This means to control the relationship between your parameters and the pseudo-static address you want to write !! Generation should be regular!
You can refer to the third floor!
------ Solution --------------------
You must modify your program to adapt to pseudo-static
------ Solution --------------------
Mark it, and look back.
------ Solution --------------------
The output link address changes.
For example, you used to be news. php? Id = 1
The pseudo-static address is/news/1.html.
The address in the template must use/news/1.html. Previously news. php? Id = 1
Generally, you can choose whether to enable pseudo-static state for websites. Therefore, you can determine whether the pseudo-static state is enabled and then determine what hyperlinks are output.
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