I am trying to deploy a larave/inertia/vuel project on apache in a subdirectory of /var/www/html - let’s call it “myapp”.
On the browser: /myapp shows up as /myapp/myapp, repeating myapp.
The Virtual host settings on 000-default.conf are as follows:
<VirtualHost *:80>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
Alias /myapp /var/www/html/myapp/public
<Directory /var/www/html/myapp>
AllowOverride All
Options -Indexes
</Directory>
The .htaccess on myapp/public is the original with the following line added:
RewriteBase /myapp/
Everything works fine in myapp except, for example when showing an item like
myapp/myapp/users/3 and refresh the browser, I get “404 not found” because the working link should be myapp/users/3 without the repeated myapp.
Is there a way to setup the deployment so it does not repeat myapp and when I type
myapp it actually is myapp?