Ability to have a VHOST file

ben shared this idea 3 years ago
Completed

Hello,


This is very important especially for anyone using frameworks like Laravel.

Having the possibility to edit a VHOST file to route files below the public_html to the public_html is very important to have.


Thank you.

13 votes

Comments (5)

photo

Hi Ben,

What exactly would you want to add in a vhost? Could you provide more details?

photo

Hi Ben,

While your specific request isn't available, there IS a work-around.

Within the file manager / home directory of a website I have a folder which contains inside it a laravel folder and then a public_html folder. Then in the public_html's index.php script it should look something like this (note the ../ paths):

https://i.imgur.com/6eKK6u3.jpg

It's not perfect but it does allow Laravel to function properly on a domain/subdomain without exposing the laravel backend to the public web.

photo

Thank you and sorry but I did not notice that I had replies on many of my requests.

Hi Mike, yes the above installation / changes is what I usually use to each installation. While on local servers, I jus edit the host file. No worries.

In a way, I don't think having this coded in your Spanel will justify the cost / usage for other clients using the feature(if they pretty much all change the code manually). 

You may delete this request please Vlad, thank you.

photo

MikeT, I have found a better trick, edit the domain root folder (in the Spanel) to point to the public folder of Laravel located just below the public_html directory. This way, there's no need to modify any file paths. I've been implementing this approach for all my new accounts. When a user enters www.XYZ.com, it automatically redirects to user/laravel/public/. You won't have to change any paths within the index.php file, and this method works seamlessly. It also allows me to compile the apps within the public folder without the need to separate them from my public_html uploads.

photo

The public folder must be set to CHMOD 755 or it will not work.

Leave a Comment