I have the following site structure:
enter image description here

How can I transfer my project to hosting?
At the same time, in the Open Server, I installed the public folder with the domain folder. enter image description here enter image description here

    2 answers 2

    If the root folder for the site files is different from the www folder (public_html) (usually the project files on Laravel are in the public folder), in this case you need to write the following structure in the .htaccess file.

    # public_html/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule ((?s).*) public/$1 [L] </IfModule> 
    You also need to create a .htaccess file in the public folder and write directives into it.
     # public_html/public/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L] </IfModule> 

      The first picture is the structure of your server, and not specifically the site. Your site will be in public_html. It is in public_html that the contents of laravel.loc (C: \ OpenServer \ domains \ laravel.loc) must be placed

      • Yes, yes, I put it wrong. Well, if the files can be directly accessed, then it does not threaten security? For example, if .htaccess will not work? - user242433