加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – Laravel获得500内部服务器错误

发布时间:2020-12-14 19:46:18 所属栏目:大数据 来源:网络整理
导读:我有共享托管的laravel项目,我的结构应用程序是 /home/username`-fontEndApps ( my laravel apps )``-backendApps ( my laravel apps )``-public_html` 在公共html我把index.php,htaccess和admin文件夹,在admin文件夹中有index.php和htaccess 后端工作正常,
我有共享托管的laravel项目,我的结构应用程序是
/home/username

`->fontEndApps ( my laravel apps )`

`->backendApps ( my laravel apps )`

`->public_html`

在公共html我把index.php,htaccess和admin文件夹,在admin文件夹中有index.php和htaccess

后端工作正常,但是当我尝试访问www.domain.com/segment1或www.domain.com/segment1/segment2时前端我总是得到500个内部服务器错误,这是我的前端和后端的htaccess文件

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options +FollowSymLinks
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$/$1 [L,R=301]

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

请帮我弄清楚这个问题

你的问题是.htaccess文件.在goDaddy中,他们不会设置RewriteBase,因此您必须在.htaccess文件中提供它.完整的代码是这样的.这与我的laravel组合 site一起使用
<Limit GET POST PUT DELETE>
#For REST support
       Allow from all
 </Limit>

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase / # <------------ This one you missed

    #Just to redirect to www.site.com when only site.com comes
     RewriteCond %{HTTP_HOST} !^www. [NC]
     RewriteRule ^(.*)$http://www.%{HTTP_HOST} [R=301,L]
    #end of codes

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$/$1 [L,R=301]

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读