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
- Create Database on your online cpanel
- Upload your project or use git to do that
- Set everything up on your ENV
- 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
Continue Reading
Be first to comment