In apache. htaccess, the 301 redirection cashes do not have the www domain name to jump to the domain name with the www

Source: Internet
Author: User
Apache. the 301 redirection in htaccess enables the website to be collected from a domain name without a www domain name: create a file redirect in the root directory. htaccess with Options + FollowSymlinksRewriteEngineonRewriteCond % {HTTP_HOST} ^ bysui. apache. 301 redirection in htaccess enables jump without a www domain name to a domain name with www
Methods collected online:

Create the file redirect. htaccess in the root directory. the content is

Options + FollowSymlinks
RewriteEngine on
RewriteCond % {HTTP_HOST} ^ [NC]
RewriteRule ^ (. *) $ [L, R = 301]

Why didn't I implement redirection?

Thank you.

------ Solution --------------------
Local or server
Restart the server if it cannot be changed.
------ Solution --------------------
Apache supports redirection.
------ Solution --------------------
Note that if you use NC, you will transfer to RewriteRule.

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: 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.