Parsing pseudo-static htaccess rules-PHP Tutorial

Source: Internet
Author: User
Parse the pseudo-static rules of htaccess. Others, pseudo-static can be combined with others very well, and pseudo-static can be combined with SEO very well to improve the ranking of the site, and also give a stable impression.

Since the pseudo-static state must be set completely based on different sites, we can only briefly introduce its principle and provide several examples of common programs:

To use pseudo-static data through htaccess, the space provider must support the Rewrite module, which is responsible for URL rewriting. Otherwise, even if it is set, it cannot be used, and a 500 error may occur.

The following is the pseudo-static setting text of Discuz:

# Enable RewriteEngine mode
RewriteEngine On
# Do not modify Rewrite system rules
RewriteRule ^ archiver/(fid | tid)-[0-9] + \. html) $ archiver/index. php? $1
RewriteRule ^ forum-([0-9] +)-([0-9] +) \. html $ forumdisplay. php? Fid = $1 & page = $2
RewriteRule ^ thread-([0-9] +)-([0-9] +)-([0-9] +) \. html $ viewthread. php? Tid = $1 & extra = page \ % 3D $3 & page = $2
RewriteRule ^ space-(username | uid)-(. +) \. html $ space. php? $1 = $2
RewriteRule ^ tag-(. +) \. html $ tag. php? Name = $1

The following is the pseudo static setting text of Phpwind:

RewriteEngine On
RewriteBase/
RewriteRule ^ (. *)-htm-(. *) $ 1.php? $2
RewriteRule ^ (. *) simple/([a-z0-9 \ _] + \. html) $1/simple/index. php? $2

There are also many different rules. if you want to develop pseudo-static rules for your site, you must be familiar with the website structure and regular expressions.

...

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.