Multiple Laravel 5 projects on the same domain

后端 未结 5 1474
星月不相逢
星月不相逢 2020-12-18 13:10

I got several Laravel 5 projects running on subfolders, on the same domain.

Each Laravel application is generating it\'s own session cookie, and sometimes it generat

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 13:55

    Edit httpd.conf file as

    Please check that path may differ according to your system /opt/lampp/htdocs/ or /var/www/html/

    ## Path to laravel sub-folder
    Alias /admin-boilerplate/ "/opt/lampp/htdocs/admin-boilerplate/public/"
    
        AllowOverride All
    
    

    And you may need to edit .htaccess file in public folder as

    RewriteBase /admin-boilerplate
    

    Full code look like

    
        
            Options -MultiViews -Indexes
        
    
        RewriteEngine On
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    
        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    
        # It enables routes when documrnt root set to public foder in httpd.conf file
        # change name according to alias name
        RewriteBase /admin-boilerplate
    
    

提交回复
热议问题