About url rewriting * & nbsp; enable Rewrite module & nbsp; * RewriteEngine & nbsp; on & nbsp; * for & nbsp; * RewriteCond & nbsp; % {HTTP_HOST} & nbsp; admin.gb.cn & nbsp; [NC] * If the file exists, access the file directly without Rewri url rewriting.
/* Enable the Rewrite module */
RewriteEngine on
/* For domain names from "admin.gb.cn */
RewriteCond % {HTTP_HOST} admin.gb.cn [NC]
/* If the file exists, access the file directly without RewriteRule .*/
RewriteCond % {REQUEST_FILENAME }! -F
/* Transfer to admin. php */
RewriteRule ^ (. *) $ admin. php [L]
/* If the file exists, access the file directly without RewriteRule .*/
RewriteCond % {REQUEST_FILENAME }! -F
/* Transfer to index. php */
RewriteRule ^ (. *) $ index. php [L]
This is the comment I wrote. I don't know, right. Another question
Is {HTTP_HOST} a domain name .. What is % {HTTP_HOST }?
There is
I understand. The first section is the admin portal, and the second section is the www Portal. Why does www
No RewriteCond % {HTTP_HOST} www.gb.cn [NC]? How about limits?
------ Solution --------------------
This is like the if else structure.
If the condition is true, the branch is false if the condition is not met.
Www.gb.cn and xxx.gb.cn do not comply with admin.gb.cn, and there are no other requirements. So they all
RewriteRule ^ (. *) $ index. php