Laravel 在 Apache 中如何部署 .htaccess

根目錄的中的.htaccess設定為

DirectoryIndex index.php
RewriteEngine On 
RewriteRule ^$ public/index.php [L]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

至於public/.htaccess 則不要做任何更改

另外,相信在 LiteSpeed 中也是差不多的做法

後記

後來發現其實在apache還有一個問題,也不知算不算是apache問題,準確說應該是Virtual hosting 虛擬主機/網頁寄存的問題

因為Laravel 的filesystem... 內置放了在 app_root/storage/,要用Linux 指令生成Symbolic link,不是每間hosting 都會給你有輸入Linux指令的權限

我相信有可能要去了解一下 config/filesystems.php 有沒有更改storage_path() 目錄的可能性,