Map a domain in htdocs/subfolder
Posted: 08. October 2020 15:38
Hello everyone, I'm Marco and I'm new in this forum.
I write this post because I have been running tests for weeks, but I can not do anything.
My system is Ubuntu 18.04.5 and the version of XAMPP is 7.4.4-1, I installed XAMPP by downloading the .run from the official site (so the installation is in the "opt" folder), I have a domain that I manage via cloudflare and use only https connection.
For the topic I will use for example mydomain.com
What I'm trying to do is make "https://test.mydomain.com" go directly to the "htdocs/test" subfolder, and "https://test2.mydomain.com" directly to "htdocs/test2".
Port configurations are ok (https://mydomain.com/test works).
I have tried to follow multiple guides on the internet, consulted the official documentation, and read many other previous posts in this forum, but have not found a solution (that works for me).
From what I understand, the comment # "Include etc/extra/httpd-vhosts.conf" line in the "lampp/etc/httpd.conf" folder must be removed, the "httpd-vhosts.conf" file in the "lampp/etc/extra" folder must be modified, and finally add "127.0.0.1 test.mydomain.com" in the "hosts" file in the "etc" folder in the Ubuntu root.
Well, nothing works, test.mydomain.com always points to the "htdocs" folder, then to the XAMPP dashboard.
To be sure, I also tried to do tests locally without using domains and going out on the internet, not even here I was successful.
I've edited the above mentioned files hundreds of times, nothing changes.
In desperation, I tried using .htaccess, the "redirect" works, but I get a 403 error for lack of privileges, or lack of DocumentRoot.
Can you explain to me how to perform the procedure correctly?
I kindly ask you to be specific in the steps to be done, and in the syntax to be written, because as I said, the other posts in the forum, or the guides on the internet, which I have followed to the letter, have not worked.
Thanks in advance and have a nice day everyone
I write this post because I have been running tests for weeks, but I can not do anything.
My system is Ubuntu 18.04.5 and the version of XAMPP is 7.4.4-1, I installed XAMPP by downloading the .run from the official site (so the installation is in the "opt" folder), I have a domain that I manage via cloudflare and use only https connection.
For the topic I will use for example mydomain.com
What I'm trying to do is make "https://test.mydomain.com" go directly to the "htdocs/test" subfolder, and "https://test2.mydomain.com" directly to "htdocs/test2".
Port configurations are ok (https://mydomain.com/test works).
I have tried to follow multiple guides on the internet, consulted the official documentation, and read many other previous posts in this forum, but have not found a solution (that works for me).
From what I understand, the comment # "Include etc/extra/httpd-vhosts.conf" line in the "lampp/etc/httpd.conf" folder must be removed, the "httpd-vhosts.conf" file in the "lampp/etc/extra" folder must be modified, and finally add "127.0.0.1 test.mydomain.com" in the "hosts" file in the "etc" folder in the Ubuntu root.
Well, nothing works, test.mydomain.com always points to the "htdocs" folder, then to the XAMPP dashboard.
To be sure, I also tried to do tests locally without using domains and going out on the internet, not even here I was successful.
I've edited the above mentioned files hundreds of times, nothing changes.
In desperation, I tried using .htaccess, the "redirect" works, but I get a 403 error for lack of privileges, or lack of DocumentRoot.
Can you explain to me how to perform the procedure correctly?
I kindly ask you to be specific in the steps to be done, and in the syntax to be written, because as I said, the other posts in the forum, or the guides on the internet, which I have followed to the letter, have not worked.
Thanks in advance and have a nice day everyone