简体   繁体   English

laravel 5.4在子域上不起作用

[英]laravel 5.4 not working on subdomain

Steps I followed till now: 我到现在为止遵循的步骤:

  1. create sub-domain. 创建子域。

  2. uploaded project files of public inside public_html/subdomain-name/ 在public_html / subdomain-name /中上传了public的项目文件

  3. create a folder subdomain-name in root 在根目录中创建一个文件夹子域名

  4. upload every files of laravel project except public folder inside subdomain-name folder 上载laravel项目的所有文件,但子域名文件夹中的公共文件夹除外

  5. change 2 lines of index.php which is inside public_html/subdomain-name/ as to: 将位于public_html / subdomain-name /内的index.php 2行更改为:

require __DIR__.'/../../../staging/bootstrap/autoload.php';

and

$app = require_once __DIR__.'/../../../staging/bootstrap/app.php';

And my htaccess files looks like: 我的htaccess文件如下所示:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I am getting error as: 我收到以下错误消息:

This page isn't working staging.mydomain.com is currently unable to handle this request. HTTP ERROR 500

Can somebody guide me with this? 有人可以指导我吗? Thank You 谢谢

2. uploaded project files of public inside public_html/subdomain-name/ 2.在public_html / subdomain-name /中上传public的项目文件

When you create a subdomain, a folder appears in your root directory, you should upload project files of public into created subdomain folder. 创建子域时,根目录中会出现一个文件夹,您应该将public的项目文件上传到创建的子域文件夹中。 ie (example.your site.com) and not into public_HTML/subdomain 即(example.your site.com),而不是进入public_HTML / subdomain

You should also try this in your .htaccess 您还应该在.htaccess中尝试此操作

Options -MultiViews 选项-MultiViews

RewriteEngine On

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM