Pretty URL/Custom Domain Question
-
I have several projects and I want to set it up to where I can access individual projects like so:
project1.test/index.html
However, right now, in order to actually access my project, it has to be done like this:
project1.test/project1/index.html
In my root directory, I have several subfolders for projects I'm working on (project1, project2, project3, etc). I guess I'm trying to figure out how I can set up a custom test domain through Laragon for my projects.
Would someone be able to guide me in the right direction? Thank you beforehand for any info you may provide.
-
@dev_dharry :
Can you show me the Virtual Host file of your project1?
-
Sure and thanks!
My auto.project1.test.conf file looks like this:
define ROOT "C:/laragon/www/project1/"
define SITE "project1.test"<VirtualHost *:80>
DocumentRoot "${ROOT}"
ServerName ${SITE}
ServerAlias *.${SITE}
<Directory "${ROOT}">
AllowOverride All
Require all granted
</Directory>
</VirtualHost><VirtualHost *:443>
DocumentRoot "${ROOT}"
ServerName ${SITE}
ServerAlias *.${SITE}
<Directory "${ROOT}">
AllowOverride All
Require all granted
</Directory>SSLEngine on SSLCertificateFile C:/laragon/etc/ssl/laragon.crt SSLCertificateKeyFile C:/laragon/etc/ssl/laragon.key
</VirtualHost>
-
@dev_dharry : Your virtual host looks good. You can access https://project1.test without any issue.
Can you show me some images to make sure I don't misunderstand your issue?
-
Local Directory Path
URL Path: project1.test/index.html
URL Path: project1.test/project1/index.html
-
@dev_dharry : Strange!
With the error message related to DNS when you browsing project1.test/index.html, you can't browser project1.test/project1/index.html
-
Yeah, it's pretty bizarre. It's as if there is something else in the way...not sure.
If I try to go to just project1.test in my browser, it just takes me to the root Laragon page.
I'll tinker with this some more but it's a strange issue indeed.
-
I figured it out!
By default, Laragon was using an older version of Apache and I didn't notice until I started looking into the httpd.conf file.
I simply switched to a newer version of Apache I had installed and it worked!
Thank you for your help!