How to jump an ISAPIRewrite statement without a www domain name to an ISAPIRewrite statement with a www domain name-php Tutorial

Source: Internet
Author: User
I want to write ISAPIRewrite without the www domain name to the domain name without the www domain name. comzb jumps to www. abc. note that the path after the domain name must be RewriteCondHost: ^ abc.com (. *) RewriteRule (. *) www.abc.com $1 [I, RP] in this case, I want to write the Rewrite method of ISAPI that does not contain the www domain name to the domain name with the www domain name.
I want to jump to http://www.abc.com/zb/

Note that the path after the domain name must also be included.

RewriteCond Host: ^ abc \. com (.*)
RewriteRule (. *) http \: // www \. abc \. com $1 [I, RP]

What's wrong with me?

------ Solution --------------------
Discussion

RewriteEngine on
RewriteCond % {http_host} ^ abc.com [NC]
RewriteRule ^ (. *) $ http://www.abc.com/#1 [L, R = 301]

------ Solution --------------------
Discussion

Reference:

It doesn't matter if it's not a directory.
Example:

RewriteCond % {HTTP_HOST} ^ 162100.com [NC]
RewriteRule ^ (. *) $ http://www.162100.com/#1 [L, R = 301]

This method is incorrect.

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.