Pseudo-Static Internet address in addition to the. htaccess and template links to change, there is nothing to note

Source: Internet
Author: User
Pseudo-Static URLs in addition to the. htaccess and template links to change, what else should be noted?
This post was last edited by sky94132003 on 2014-06-24 17:22:34

Recent sites want to change URLs to pseudo-static URLs

The following settings have been made in. htaccess,


Rewriteengine on

Rewriterule news/([1-9]+[0-9]*) $ news_info.php?id=$1

Rewriterule news/([1-9]+[0-9]*)/$ news_info.php?id=$1

Manual input: URL/news/123/

has been able to successfully go, of course, CSS path will be modified,

Also need to change the template RELATED links?
For example, in a news list, change the news_info.php?id=$_get["id" to/news/$_get["id"]/




So...

First step: Set the. htaccess

Step Two: Modify the links in the template?

Is this wrong? Or should there be more to be done?

In addition, in this case, the host consumption and load impact is not big?
------Solution--------------------
1. Using the rewrite (regular), the CPU will have some occupancy, but the impact is small.
2. Connections in templates (Nellian) It's best to write a way to do it.
For example
/news.php?id=123 Rewrite for/news/123
Echo ' NEW List ';

function URL ($file, $id) {
return $file. ' /'. $id;
}

If one day do not want to use rewrite the URL want to use back/news.php?id=123
You only need to modify
function URL ($file, $id) {
Return $file. Php?id= '. $id;
}

This will not change every URL.
  • 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.