2021年5月7日星期五

Set Root Folder To SubFolder In Apache On LocalHost That Will Also Work On Production Server

I have a project that has a 'public' and 'private' folder structure that sit at the same level inside the main project root folder (see attached image).

I would like so that the local server (in this case MAMP) automatically defaults to the 'public' folder as the domain root. Is it best to do this is in php or in Apache?

Also, when I upload the site to a production server the domain name is going to be set on the 'public' folder, so I'd ideally like a solution that means I when I upload the site this will still be the case - i.e. www.example.com will be the 'project/public' folder.

This is all new to me so am at a bit of loss as to the best way to approach this.

folder structure

https://stackoverflow.com/questions/67443435/set-root-folder-to-subfolder-in-apache-on-localhost-that-will-also-work-on-produ May 08, 2021 at 10:04AM

没有评论:

发表评论