Migrating files from the public folder in laravel

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Migrating files from the public folder in laravel

Post by gautamz07 »

hey guys have any of you guys ever use laravel for production and had to migrate all the files from the PUBLIC folder to the root folder so that you website would open when you go to www.yourwebsite.com and not www.yourwebsite.com and not www.yourwebsite.com/public . What are the steps that you had to take ?

Thank you.
Gautam.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Migrating files from the public folder in laravel

Post by Celauran »

Document root should be pointing to /public/ on both dev and prod. Which files are you talking about moving?
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Migrating files from the public folder in laravel

Post by gautamz07 »

so the public folder can remian in production also ?? how do i point the document root to the public folder ??

I mean i just want my site to be visible when i go to www.yourwebsite.com vs right now I.E. www.yourwebsite.com/public

Thank you.
Gautam.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Migrating files from the public folder in laravel

Post by Celauran »

gautamz07 wrote:so the public folder can remian in production also ?? how do i point the document root to the public folder ??

I mean i just want my site to be visible when i go to http://www.yourwebsite.com vs right now I.E. http://www.yourwebsite.com/public

Thank you.
Gautam.
DocumentRoot is generally specified in the VirtualHost definition.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Migrating files from the public folder in laravel

Post by gautamz07 »

Do i have to edit something in my laravel application ?? i am not sure , i am understanding you.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Migrating files from the public folder in laravel

Post by Celauran »

Should be done at the Apache level, not in Laravel itself. Worst case, you can try with an .htaccess file in the root that sends all requests through to /public/. Try to fix the vhost definition first, though.

https://httpd.apache.org/docs/2.4/vhosts/
Post Reply