Apache user authentication and domain jump

Source: Internet
Author: User

[Email protected] abc]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
DocumentRoot "/data/www"
ServerName www.qq.com
Serveralias www.aqq.com
# errorlog "Logs/dummy-host.example.com-error_log"
# customlog "Logs/dummy-host.example.com-access_log" common

#users Ren Zheng

<Directory/data/www/abc>//user authentication

AllowOverride authconfig
AuthName "QQX"
# AUTHUSERFILE/DATA/.HTPASSWD
AuthType Basic
authuserfile/data/.htpasswd
Require Valid-user

</Directory>

<ifmodule mod_rewrite.c>//Domain jump 301

Rewriteengine on

Rewritecond%{http_host} ^www.qq.com$

Rewriterule ^/(. *) $ http://www.xx.com/$1 [r=301,l]
</IfModule>

</VirtualHost>

When you add multiple virtual hosts, the servername is different to access


This article is from the "ZPP" blog, make sure to keep this source http://1439337369.blog.51cto.com/10270624/1706678

Apache user authentication and domain jump

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.