Url rewriting solution

Source: Internet
Author: User
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

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.