Proper deployment of a Laravel application (.htaccess, /public)
I am developing an app with Laravel that gets self-hosted by the customer. Now, in my documentation I want to describe how to install the app. My app shall be embedded on websites with, e.g. an iframe. Nonetheless it needs to be hosted most probably on the same webserver. For instance if I have the URL www.example.com/ticketsystem the "ticketsystem" is the root project directory. How can I now route every request in that directory to the /public directory? I tried some .htaccess files but everyone I got there was the public folder name in the URL. I want to hide the public directory name in the URL and also don't want users have access to everything except the public folder. My question now is: Do I have to achieve that entirely with an .htaccess file (how?) or do I have to instruct the user to redirect requests of the project root to the public folder via his server control panel?
You need to point the webserver to the public directory. You can't put the .htaccess file in your root directory and make it work.
Laravel already comes by default with a .htaccess file in the public directory that works ;) The only thing you need to do on the server is pointing the domain to the public directory of your project.
It depends on the server on how you need to do this. This can be nginx or plesk or some other tool that can do this for you.