Connect with us

Easy way to Host your Laravel Application on Shared Hosting

kizinho

Published

on

Follow
DEVELOPER PROGRAMMING: Easy way to Host your Laravel Application on Shared Hosting [New  Developer Programming] » Naijacrawl
Photo: Naijacrawl
site

Hi , Folks have you finished building that your awesome project but hosting it o shared hosting is what remains, don't worry you are on the right track, I have the best way to do that.

Steps

  1. Create Database on your online cpanel
  2. Upload your project or use git to do that
  3. Set everything up on your ENV
  4. now we need .htaccess that you will create inside your laravel root folder


Inside the .htaccess add this code

RewriteEngine On#endsRewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public/$1RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteRule ^(/)?$ public/index.php [L]

Replace with your domain

What this code does is that when you host your laravel application and access it, it will show the user the original folder of your project, unless you go to the public before it can load the project as a web but now enjoy hosting with shared hosting after following the above steps.

Enjoy and share

Click Here To Comment


site


kizinho

I am a software developer, like meeting people and love blogging, that's why I developed naijacrawl because that's what I love doing.

Continue Reading
Click to comment

Be first to comment


    Leave a Reply

    Your email address will not be published. Required fields are marked *

    How to show a nice message to the user when an error occurs in using Guzzle with Laravel

    kizinho

    Published

    on

    DEVELOPER PROGRAMMING: How to show a nice message to the user when an error occurs in using Guzzle with Laravel [New  Developer Programming] » Naijacrawl
    Photo: Naijacrawl
    Hi Folks, have you encountered an ugly Exception when making a post, get, put, delete to external API when an error like 500 or 404 occurs. Today you are at the right place, after reading this you will be able to show a nice message to your users in case of any of those errors occursWhen making a request to external API using guzzle to solve this problem you will need to catch the Exception by following the steps below.Prepare your request using Guzzle, I believe yo...
    Continue Reading

    Laravel 6 and 7 Package for Paystack

    kizinho

    Published

    on

    NEWS: Laravel  6 and  7 Package for Paystack [New  Developer] » Naijacrawl
    Photo: Naijacrawl
    Hi, Folks since the release of laravel version 6 and 7, it is very difficult to easily use Paystack on it due to lack of maintenance but today unicodeveloper of the package have taken his time to release a new update on the package.To use it, you just need to follow the same pattern we normally do and get things working back again.Visit the package URL here
    Continue Reading

    Latest