Hi, I know this is a really stupid question but I always develop my applications by moving the contents of the "Public" folder into the root, obviously putting everything in safety. I got used to it, but I understand that it is not the correct way.
I would like to understand better how to access my new Laravel installation as if there was already the index in the root instead of going into the public folder.
Let me explain even better, I would like to understand how to access my site example.com instead of example.com/public
Do I need to edit the .htaccess file? And inserting what?
I ask for patience, unfortunately I got used to that other way and I would like to redeem myself :)
Unfortunately I am not able to solve, I state that I am using XAMPP, I did it this way, once I have saved the file I restart xampp, but now only the 404 error appears by going to localhost/project
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName test.dev
ServerAlias test.dev
ErrorLog "logs/laravel.log"
CustomLog "logs/custom.laravel.log" combined
<Directory "C:/xampp/htdocs/project/public">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
It won't be available at https://localhost because you need to present the name of the site in your browser request in order for virtual hosts to work.
You may need to add an entry to your hosts file so that test.dev resolves to localhost
Back to the discussion, by necessity I would need to simplify this process and find a solution such as editing the htaccess. In this regard, in the root I created the .htacces file by inserting the following code but also this time 404 error appears.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/ [L]
</IfModule>
I would like to find a solution where my possible client who goes to install my application does not have to make these changes, but after having uploaded all the files to be able to visit his site already as mysite.com. What solutions can I adopt? I've tried them all.