Dec.10

Change need to Laravel site when hosting in to cpanel

Step 1:

We need to clear the config file at first. It has previous configuration on that file. delete or name that file.

<site_folder>/bootstrap/cache/config.php

 

Step 2:

Rename server.php in your Laravel root folder to index.php

 

Step 3:

Copy the .htaccess file from /public directory to your Laravel root folder.

Add Code into Htacces file:

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]

 

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment