Please help me modify the regular code. it cannot completely match 1. requirement: process the addresses in all href on the webpage and place them back in the original place. because the css address is also the beginning of href and http, you need to set & lt; a matches (the URL may be in the form of www.qq.com or www. qq. comsdfsd. php? Id10 & amp; dsfsdsf and so on). please help me modify the regular code below, but it cannot be completely matched.
1. requirement: process all the addresses in the href = "" in the web page and then back to the original place, because the css address is also the beginning of href and http, so you need to http://www.qq.com this form, could it be a http://www.qq.com/sdfsd.php? Id = 10 & dsfs = dsf and so on), my code below, the http://ygtc.tmall.com can match, but the http://phny.tmall.com is not, after analysis found that the following URL
$ 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]