laravel htaccess redirect to public code example
Example 1: htaccess redirect to public folder
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php?$1 [L,QSA]
Example 2: redirect http to https htaccess laravel 8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https:
RewriteRule ^(.*)$ public/ [L]
</IfModule>
Example 3: public laravel htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Example 4: laravel project htaccess redirect to public path
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]