I want to edit my .htaccess file so all the requests will be encrypted (I have SSL certificate active). I'm trying to run a Laravel app, which has Index file in public folder and I want to let user access my page without the /public/ part in URL.
So far, I managed to do this:
This part let me access the page without the /public/ part.
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
This part redirects all data to HTTPS:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.club/public_html/1 [R,L]
The question is, how do I merge these two together? They work separately, but not if I put this together in .htaccess file.
.htaccess file is located in public_html
which is located in root folder. Laravel folders (incluing public
) are located in this folder.