Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

VestaCP and Laravel

General questions about VestaCP
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
fedekrum
Posts: 49
Joined: Mon May 12, 2014 7:45 pm

Os: Ubuntu 15x
Web: apache + nginx
VestaCP and Laravel
  • Quote

Post by fedekrum » Mon Apr 02, 2018 3:01 pm

Hi all.
Suppose I have a site called utilities.mydomain.com.

Inside there, I want to make several laravel projects in each folder.
eg.
utilities.mydomain.com/tool1
utilities.mydomain.com/tool2
utilities.mydomain.com/toolx

How can I make all these work with simply adding .htaccess file/s somewhere in utilities.mydomain.com or any other place?

Points.
a) I don't want to split the Laravel folders as I saw in other tutorials. Each folder must be a pure installed Laravel project.
b) I can make "utilities.mydomain.com/tool1/public" work with no problem with simply adding "composer create-project laravel/laravel toolz" inside the public_html folder, but I want to get rid of the "public/" term in the URL.

Thanks, Federico
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: VestaCP and Laravel
  • Quote

Post by tjebbeke » Sun Apr 08, 2018 9:24 am

You can do this with htaccess files.

utilities.mydomain.com/public_html/toolx/.htaccess

Code: Select all

<IfModule mod_rewrite.c>
	RewriteEngine on
    RewriteBase /toolx
	RewriteCond %{REQUEST_URI} !^toolx/public
	RewriteRule ^(.*)$ /toolx/public/$1 [L]
</IfModule>
utilities.mydomain.com/public_html/toolx/public/.htaccess

Code: Select all

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    
    <IfModule mod_headers.c>
      <FilesMatch ".(js|css|xml|gz|html)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>

    RewriteEngine On
    RewriteBase /toolx

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /toolx/$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
Top

k26
Posts: 12
Joined: Sat Feb 10, 2018 4:56 am

Os: CentOS 6x
Web: apache + nginx
Re: VestaCP and Laravel
  • Quote

Post by k26 » Tue May 29, 2018 8:13 am

just facing the same problem as @fedekrum and discovered your solution @tjebbeke , but after some tests it does not run for me ....
when we call the toolx url I have a message "Sorry, the page you are looking for could not be found"
and if I add index.php then I can continue but all the next links will display toolx/public/rest_of_url
Maybe because I run L5.6 ?
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password