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]