繁体   English   中英

虚拟主机重定向在Apache中不起作用

[英]Virtual host redirection not working in apache

我点击此URL 后就创建了一个简单的虚拟域http://team.xyz.ae ,我想将http://team.xyz.ae/users/login but now its redirecting to

http://team.xyz.ae/users/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/loginusers/login

这就是我写的创建虚拟主机的内容

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/xyz/
    Redirect permanent / http://team.xyz.ae/users/login
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

请参阅https://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirectRedirect重定向以给定URL开头的任何请求。

您可能要改用RedirectMatch

RedirectMatch permanent "^/$" http://team.xyz.ae/users/login

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM