Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nazar1987's avatar

Godaddy hosting and laravel

hi to day i host my project in godaddy.com when i but the the project in public_html and used htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

the project work but i want but the project in sub folder like public_html/example it work but must but public folder in url like www.mysite.com/example/public how can i remove public folder ??

0 likes
29 replies
mehany's avatar

You may not need to remove the public folder. You need to tell Laravel where to load the publicly available folder from ( That could be www or public_html or html ). The above link will provide you with a good idea of how to configure application paths. Godaddy has a public_html!

 // the recommended way
 laravel_application
 public_html

P.S: I don't recommend Godaddy!

1 like
nazar1987's avatar

yes i read it my problem when try put my project in sub folder the htaccess to remove public folder from url not work

RachidLaasri's avatar

What have you tried? because the method above works every time and i successfully deployed 3 apps with the same approach.

mehany's avatar

@nazar1987 What is the Laravel version you are using? and just to make sure, you are on a Linux hosting right?

nazar1987's avatar

i have more project build in laravel like

mysite.com/project1
mysite.com/project2
mysite.com/project3
mysite.com/project4

and i want remove public from url

sos99's avatar

on Lynda.com Joseph Lowery shows how upload the Project with Laravel 4 with Godaddy web hosting.

also their is other resources about this issue :

Deploying Laravel 5 on GoDaddy Shared Hosting : https://tinyurl.com/o88z4v4

coffee's avatar

@mehany What would you recommend then if you don't prefer godaddy? Thanks.

opheliadesign's avatar

@coffee if I can interject, anything! I started with Go Daddy years ago, became annoyed quickly with the clunky admin interface and overall feel of the company. I tried a few other shared hosting providers before I wised up to the fact that I really needed a VPS.

I now have a Wired Tree (wiredtree.com) VPS and a few sites running on Digital Ocean droplets. Wired Tree customer support has been absolutely amazing and I've only had a few brief service interruptions, but looking back I wish I had just gone with DO from the start for everything. However, Forge was not around when I started with Wired Tree.

1 like
opheliadesign's avatar

@coffee I like to compare Digital Ocean to a high performance sports car, unlike Wired Tree (and similar cPanel/WHM based systems) which is more of a mini van. It has a bit more of a learning curve and less convenience items (like cPanel, phpMyAdmin, email, etc) but is very quick and stable.

Some clients really want to have their own familiar shared hosting experience that I can give them with my Wired Tree VPS, others just want their site to work as smoothly as possible with the best performance - Digital Ocean.

1 like
undrwd's avatar

It's been a while since I have used godaddy for laravel hosting. It did work though on a shared linux hosting.

You don't need to use .htacces to remove the public folder issue you're having.

On godaddy you can place your laravel folder above the public_html folder as recommended, then you'll need to change where it's located inside the laravel files. The tutorial linked above has details about this. I think there is another one out there if you google for it that might be a little better.

So for multiple installs you would have multiple laravel project folders which contains all the laravel code.

All in the same directory with your public_html folder

laravel1 laravel2 laravel3 laravel4 public_html

Then under public_html you would have your project folders which are just the public folder out of your laravel project. Rename these project1, project2, project3 . . .

From there it's just a matter of setting the paths so they tell laravel where everything is.

It is tricky to setup I remember testing various paths to get everything to the right spot basically using ../../ to get up a couple directories. I would checkout the lynda video and google for a few more articles, get one install up and running and then duplicate it.

Hopefully that gets you up and running.

However . . .

You should really look at moving over to using homestead locally and deploying using forge to digital ocean. You can host multiple projects on a $5 digital ocean account or just be happy testing projects out locally using homestead. Deploying to Digital Ocean I would recommend using forge. It's $10/mo but well worth it. Plus you'll level up your skills since you'll be hosting your code at bitbucket and using git. You can use SourceTree (by same company as bitbucket) for a git gui.

I think you could signup for forge one month, setup your droplet and sites on digital ocean, then not renew the second month and your auto-deployment scripts should still work. Maybe someone else can verify that in this thread.

Good luck.

1 like
mehany's avatar

@coffee as mentioned by others, a great place to start is Forge and DO. I agree with opheliadesign but I don't use Wired Tree - I like pocketing that money instead ;) . I use DO for all my sites as well, it is built by developers for developers and It is indeed tailored for developers needs and they have an extensive list of articles to learn, troubleshoot, setup, and create stuff. I would say the best place to start.

Allow me to offer you $10: this DO link gets you $10 in credit, once you spent $25, and I get $25 ... Yay :)

You can host multiple projects on a $5 digital ocean account

@undrwd you don't want to do that in real world projects! take a look at this recent thread.

opheliadesign's avatar

@mehany Again, I started using Wired Tree before Forge existed - at the time it was easier to get up and running. Also, a lot of my clients are small organizations with a limited budget, they needed email out of the box and could not afford a hosted email solution (Google for Business, for example). So I needed something with email ready to go.

So it all depends on what you need, just good to know what the options are. :)

undrwd's avatar

@mehany Good, point. Multiple personal/testing projects would be ok but definitely put anything real world with traffic on their own droplet.

pardeepkumar's avatar

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

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

Also if you face any problem to host your Laravel application on shared. I suggest you to try Cloud Hosting services(DO,AWS,Linode). You can check Cloudways, They are providing manage hosting servers and DO is cheaper then Linode in their plan.

Please or to participate in this conversation.