0

i have created a simple virtual domain http://team.xyz.ae once i hit this URL i want to redirect this to 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

this is what i have written to create a virtual host

<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>
Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
Soubhagya Kumar Barik
  • 1,979
  • 20
  • 26

1 Answers1

2

See https://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect, Redirect redirects any request starting with the given URL.

You probably want to use RedirectMatch instead:

RedirectMatch permanent "^/$" http://team.xyz.ae/users/login
Alan Birtles
  • 32,622
  • 4
  • 31
  • 60