Apache Alias in Slim 4

Hi All,

We have an requirement as below, request your advice on the same. as we have 2 url as below, at present the first url “https://abc.com” works fine and we need a separate admin page and shoul dbe accessible via the url “https://abc.com/admin” we tried the blow configuration but no luck, hence request you help

URL

URL : https://abc.com
URL : https://abc.com/admin

Apache Configuration

<VirtualHost abc.com:443>
ServerName abc.com
DocumentRoot /var/www/slim4/public

 <Directory "/var/www/slim4/public">
	Require all granted
 <Directory

 Alias "/admin" "/var/www/slim4/admin"
 <Directory "/var/www/slim4/admin">
 	Require all granted
 <Directory
</VirtualHost>

.htaccess under folder /var/www/slim4/public

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

.htaccess under folder /var/www/slim4/admin

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /admin/index.php [QSA,L]

HI, maybe i don’t understand well the situation, but the domain is the same, so you don’t need to add specific configuration in the apache vhost. Use one slim app for both situation with slim routing (with middleware control if needed).

Sorry if i don’t help.