我已经创建了一个简单的虚拟域http://team.xyz.ae
当我点击该URL时,我想将其重定向到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>
答案 0 :(得分:1)
请参见https://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect,Redirect
重定向以给定URL开头的任何请求。
您可能想改用RedirectMatch
:
RedirectMatch permanent "^/$" http://team.xyz.ae/users/login