2017-07-06 81 views
1

我要上傳我的本地Laravel項目上GoDaddy的,但我有一些錯誤如何設置的.htaccess爲一個共享的主機GoDaddy的服務器

錯誤

[Wed Jul 05 21:16:44.858396 2017] 
    [autoindex:error] [pid 21796:tid 139689709188864] 
    [client 99.240.235.234:57754] 
    AH01276: 
     Cannot serve directory /home/bugsbunny/public_html/sto.com/: 
      No matching DirectoryIndex (/home/bugsbunny/public_html/sto.com/public/index.php) 
    found, and server-generated directory index forbidden by Options directive 

的.htaccess

上一個子域
DirectoryIndex /home/bugsbunny/public_html/sto.com/public/index.php 
<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    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^/home/bugsbunny/public_html/sto.com/public/index.php [L] 

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

步驟,我沒有

  • 我的編輯我的意思是改變在第一行的目錄,並通過RewriteRule
  • 開始行我切&這個文件粘貼到根目錄
  • 我上傳的項目進入編輯的公共/ .htaccess文件
  • godaddy

回答

-1

爲什麼你不使用laravel專用主機。讓您的服務器和[digitaloccean等],做你想要的...

0

在Godaddy的,我覺得它更容易地創建/上傳Laravel應用此過程

1- Create an addon domain or a sub-domain on Godaddy 
2- Install a Laravel app (Quick-install) on this domain/sub-domain 
3- Download this app on local (my computer) with Filezilla (or other sftp software) 
4- On local disk change the .env database access or (create a user+password+database on phpmyadmin/mysql with the information contain in the .env that Godaddy setup for you) 
5- finish up the app (Build the webapp project that you want to do). 
6- Upload the app to the server (except the .env) with Filezilla 
7- upload the database (mysql) from local to Godaddy 

所以沒有必要更改.htaccess文件。

相關問題