Stefano Groenland
Stefano Groenland

Reputation: 561

Laravel 5.1 to shared hosting with FTP only

I'm having trouble deploying laravel 5.1 to my shared hosting.

I have a current domain name : stefanogroenland.nl/laravel/public which shows the laravel welcome screen. Now i want to remove the need of /public so all my url's are nice and clean. Does anybody know how to fix this? i can only use FTP

if anybody knows please reply!

My FTP files under httpdocs

enter image description here

Upvotes: 1

Views: 224

Answers (1)

Drudge Rajen
Drudge Rajen

Reputation: 7987

1) Rename the server.php to index.php (no modifications)

2) Copy the .htaccess from public

Changing .htaccess it a bit as follows for statics:

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]

If there are any other static files needed just add the extension to the previous declared list

Upvotes: 2

Related Questions