htaccess pseudo-static rules
Format: request address → Destination address
1,/abc123.htm→/index.php?page=abc123
2,/a/xxxx→/a/index.php?id=xxxx
3,/b/xxxx→/b/index.php?id=xxxx
4,/xxxx.html?id=123&ty=aaa→/index.php?page=xxxx&id=123&ty=aaa
Ask the great God to write Isapi_rewrite jump rules, to achieve the above jump demand.
Urgent "Urgent" "" "
Reply to discussion (solution)
rewriterule^ (. *)/ABC (. *). html$ $1/index\.php?page=abc$2rewriterule^ (. *)/a/(. *) $ $1/a/index\.php?id=$2rewriterule ^ (. *)/b/(. *) $ $1/b/index\.php?id=$2rewriterule^ (. *)/(. *). html?id= (. *) &ty= (. *) $ $1/index\.php?page=$2 &id=$3&ty=$4
You give it a try
rewriterule^ (. *)/ABC (. *). html$ $1/index\.php?page=abc$2rewriterule^ (. *)/a/(. *) $ $1/a/index\.php?id=$2rewriterule ^ (. *)/b/(. *) $ $1/b/index\.php?id=$2rewriterule^ (. *)/(. *). html?id= (. *) &ty= (. *) $ $1/index\.php?page=$2 &id=$3&ty=$4
You give it a try
In the last rule, the ID and Ty are not fixed because similar URLs are more, some are IDs, some are not IDs.
rewriterule^ (. *)/ABC (. *). html$ $1/index\.php?page=abc$2rewriterule^ (. *)/a/(. *) $ $1/a/index\.php?id=$2rewriterule ^ (. *)/b/(. *) $ $1/b/index\.php?id=$2rewriterule^ (. *)/(. *). html?id= (. *) &ty= (. *) $ $1/index\.php?page=$2 &id=$3&ty=$4
You give it a try
In the last rule, the ID and Ty are not fixed because similar URLs are more, some are IDs, some are not IDs.
Rewriterule ^ (. *)/(. *). html? (. *) = (. *) & (. *) = (. *) $ $1/index\.php?page=$2&$3=$4&$5=$6
rewriterule^ (. *)/ABC (. *). html$ $1/index\.php?page=abc$2rewriterule^ (. *)/a/(. *) $ $1/a/index\.php?id=$2rewriterule ^ (. *)/b/(. *) $ $1/b/index\.php?id=$2rewriterule^ (. *)/(. *). html?id= (. *) &ty= (. *) $ $1/index\.php?page=$2 &id=$3&ty=$4
You give it a try
In the last rule, the ID and Ty are not fixed because similar URLs are more, some are IDs, some are not IDs.
Rewriterule ^ (. *)/(. *). html? (. *) = (. *) & (. *) = (. *) $ $1/index\.php?page=$2&$3=$4&$5=$6
or invalid, jump directly to the index.php, the following parameters are not attached on
The last rule I explain:
Is that I requested a/xxxx.html?id=123&ty=aaa where xxxx is the page name page, followed by? With the addition of ID=123&TY=AAA parameters, the parameters are variable, and these parameters need to be appended to the destination URL, i.e., index.php? page=xxxx& back
Page is also a parameter of the target page, passing the name of the current request page, that is, XXXX.
is actually trying to put/XXXX.HTML?ID=123&TY=AAA in this request "xxxx.html?" Partially replaced by "index.php?mod=xxxx&"
is actually trying to put/XXXX.HTML?ID=123&TY=AAA in this request "xxxx.html?" Partially replaced by "index.php?mod=xxxx&"
Rewriterule ^ (. *)/(. *). html? (. *) $ $1/index\.php?mod=$2&$3
is actually trying to put/XXXX.HTML?ID=123&TY=AAA in this request "xxxx.html?" Partially replaced by "index.php?mod=xxxx&"
Rewriterule ^ (. *)/(. *). html? (. *) $ $1/index\.php?mod=$2&$3
or jump invalid, a few other rules can jump normally, where should I troubleshoot the problem?
The problem still exists, and someone can point out
Rewriterule ^ (. *)/(. *). html? (. *) $ $1/index\.php?page=$2
Rewriterule ^ (. *)/(. *). html? (. *) $ $1/index\.php?page=xxxx
Rewriterule ^ (. *)/xxx.html? (. *) $ $1/index\.php?page=xxxx
Rewriterule ^ (. *)/xxx.html? (. *) $ $1/index\.php\?page=xxxx
Rewriterule ^ (. *). html\? (. *) $ index.php?mod=$1&$2
Thanks for two upstairs, I found the answer myself.
/XXXX.HTML?ID=123&TY=AAA matching rules are as follows
Rewritecond%{query_string} ^id= (. +) &ty= (. +) $
Rewriterule xxxx\.html$ index\.php\?page=xxxx&id=%1&ty=%2 [L]
This rule can match the URL with the parameter after the HTML.