A question about rewrite rules in php

Source: Internet
Author: User
Php rewrite rules: www.baidu.com/2/baidu/p5

How to write such rewrite rules, that is,. HTACCESS, baidu is not a folder but also a parameter, p5 is a parameter,
# RewriteRule ^. *-([0-9] {1,}) \/baidu/p ([0-9] {1,}) $ index. php? What I wrote conflicts with other rewrite rules. how can I use parameters with backslashes as links?


Reply to discussion (solution)

RewriteRule ^[^/]*\/(\d{1,})\/baidu\/(p\d{1,})$ index.php?baidu=$1&p=$2

Well, thank you for your answer. I hope you can find the girl on your profile picture.


Well, thank you for your answer. I hope you can find the girl on your profile picture. [/Quote
This is a bit difficult

RewriteRule ^[^/]*\/(\d{1,})\/baidu\/(p\d{1,})$ index.php?baidu=$1&p=$2

My friend, how can I put this in my. htacess? the parsing error occurs when a backslash is added. is it in conflict with other RewriteRule,
For example


Well, thank you for your answer. I hope you can find the girl on your profile picture. [/Quote
This is a bit difficult
It's okay. the pursuit is good. well, let's analyze the problem above,

My friend, how can I put this in my. htacess? the parsing error occurs when a backslash is added. is it in conflict with other RewriteRule,
For example
This is not clear.

Oh, okay. let me see it again.

What does {1,} mean?

What does {1,} mean?
Match 1 to Infinity

Yes, it is normal now that CSS reference is not normal,

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.