There is a hosting. One ip selected. It contains several sites. In connection with the interruptions with dns, you need to adjust the address by ip by mask: ip / alias -> folder.

I tried using Alias ​​(Alias ​​/ api var / www / api), but for some reason when meeting the url word api (example.com/api) it uses a redirect to the api folder. AliasMatch also does not help.

There are options how to do this?

  • Probably api is somewhere overridden. Give a complete server config. In your case, it is really logical to use Alias. Alternatively, you can use Rewrite ... - gecube
  • <VirtualHost 127.0.01: 80> ServerName api.example.com RewriteEngine on ReWriteCond% {SERVER_PORT}! ^ 443 $ RewriteRule ^ / (. *) Https: //% {HTTP_HOST} / $ 1 [NC, R, L] < / VirtualHost> <VirtualHost 127.0.01: 443> ServerName api.example.com AddDefaultCharset off DocumentRoot / var / www / sites / api SSLCertificateFile /var/www/certs/api.crt SSLCertificateKeyFile /var/www/certs/api.key SSLCACertificateFile /var/www/certs/CA.CRT SSLEngine on </ VirtualHost> - forum3
  • I tried to install Alias, it works in the case of 127.0.0.1/api, but other links such as example.com/api/get also redirects. Maybe I did something crookedly - forum3

0