Win host httpd.ini pseudo-static 301 how to redirect the issue

Source: Internet
Author: User
Tags create development group host how to http iis internet +

I have always been a headache 301 orientation, Linux is not used to their own, only some simple commands, or Win, after all, more popular, although later with the technical development will certainly use linux, but now is the first Win thorough research it .

Today for everyone to explain is that the win host without iis, the use of pseudo-static rules to achieve the orientation of 301, the problem distressed for a long time, because if 1,2 stations are ok, if you do station group, iis one re-create the site and then 301 is too much trouble, I encountered such a problem on the VPS, this also ruined a management system. So I have been looking for a similar article on the Internet for a long time can not find the right way, or not 302, or else can not be used.

Today finally found, so for everyone to explain, first of all different ISAPI_Rewrite version of the 301 and 302 rules are not the same, which is why I find the rules on the Internet does not work or prompted 302 reasons.

Under ISAPI_Rewrite 1.x: ISAPI is 1.3 Can not achieve "301 permanent redirect", only to achieve "302 temporary redirection." At this point you can use the 404 page to achieve 301 redirect.

Not much to say nonsense, I directly on the last three ISAPI version of the code is compatible, we copied to use just fine

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32

# For ISAPI_Rewrite 1.x
RewriteCond Host: ^ jzread.com $
RewriteRule (. *) Http: //www.jzread.com$1 [R, I]
# Note that 302 redirects are implemented here

# For ISAPI_Rewrite 2.x
RewriteCond Host: ^ jzread.com $
RewriteRule (. *) Http: //www.jzread.com$1 [I, RP]

# For ISAPI_Rewrite 3.x
RewriteCond% {HTTP: Host} ^ jzread.com $
RewriteRule (. *) Http: //www.jzread.com$1 [NC, R = 301]


Add the above code to the HTTPD.INI this file can be!


Related Article

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.