Please help me modify the regular code. it cannot be completely matched.

Source: Internet
Author: User
Please help me modify the regular code. it cannot completely match 1. requirement: process all the addresses in the href = "" in the web page and then put them back to the original location. because the css address is also the beginning of href and http, you need to & lt; a match together (the URL may be in this form of http://www.qq.com, or it may be a http://www.qq.com/sdfsd.php? Id = 10 & amp; d
1. requirement: process all the addresses in the href = "" on the web page and put them back in the original place. because the css address is also the beginning of href and http, you need

$ Con = file_get_contents ("http://phny.tmall.com"); // or $ con = file_get_contents ("http://ygtc.tmall.com ");
$ Con = preg_replace_callback ('/(echo $ con;
 
Function url ($ url ){
Return $ url [1]. '#'; // This is a simple example. it is actually more complex than this example.
}


2. for a pseudo-static rule, demand: access to the http://www.abc.com/taobao/phny/ or http://www.abc.com/phny/ are switched to show. php \? Domain = $1. if the URL contains an images string, this rule is not matched.

The code I wrote is as follows, but it does not work.

RewriteRule ([a-zA-Z\d=]+)/?$ show.php\?domain=$1

------ Solution --------------------
If so
The http://www.abc.com/taobao to the http://www.abc.com/show.php? Domain = taobao
The http://www.abc.com/taobao/phny to the http://www.abc.com/show.php? Domain = taobao/phny

It can be used in this way (the path does not include. jump)
RewriteEngine on
RewriteRule ^ [^ \.] + $/show. php? A = $0 [R, L]

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.