Laravel htaccess issue

后端 未结 2 1086
情话喂你
情话喂你 2020-12-31 11:54

I\'m trying to set a site live. The site works perfectly fine on a live dev server which we\'ve been using to show the site to the client. Here is the htaccess from the live

相关标签:
2条回答
  • 2020-12-31 12:39

    I had exactly same setup as RamiroRS answer, but still got Internal Server Error. My problem was in file permissions. Folders should be 0755 and files 0644.

    0 讨论(0)
  • 2020-12-31 12:40

    Use at same level of /public

    This way first redirect to public

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.domain.com$
    RewriteCond %{REQUEST_URI} !public/
    RewriteRule (.*) /public/$1 [L]
    

    And inside /public

    then, you handle index.php

    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
    </IfModule>
    
    
    <IfModule mod_rewrite.c>
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    
    0 讨论(0)
提交回复
热议问题