That’s what I was trying to do (using Apache 16) I have two enabled config files.
<VirtualHost *:80>
ServerAdmin admin@something.com
ServerName mydomain.com/project_1
ServerAlias www.mydomain.com/project_1
DocumentRoot /var/www/project1/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
And the other one (for an entirely different project) would be:
<VirtualHost *:80>
ServerAdmin admin@something.com
ServerName mydomain.com/project_2
ServerAlias www.mydomain.com/project_2
DocumentRoot /var/www/project2/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I’ve tried it and it didn’t really work.
Do I need to change my domain droplet records to make it work? Because there’s no option for routes there…
I assume I did something stupid and that this question is very unprofessional, but still, I would love to get some help please :)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello friend!
Great question! What you would do here is use only one of these, and make it like this:
Now create these two folders: /var/www/project1 /var/www/project2
So traffic to mydomain.com/project1 or www.mydomain.com/project1 loads the contents of /var/www/project1, and so on for each project you need :)
Kind Regards, Jarland