我无法将laravel 5.1部署到我的共享主机。
我有一个当前的域名:stefanogroenland.nl/laravel/public
,显示了laravel欢迎屏幕。现在我想删除/ public的需要,所以我的所有网址都很干净。有人知道如何解决这个问题吗?我只能使用FTP
如果有人知道请回复!
httpdocs下的我的FTP文件
答案 0 :(得分:1)
1)将server.php重命名为index.php(无修改)
2)从公共
复制.htaccess更改.htaccess它有点如下静态:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
如果需要任何其他静态文件,只需将扩展名添加到之前声明的列表