I have been trying for 3 days still didn't find any solution of it. I have tried so many solution still remained same.
Here is my .htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (. )/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Here my laravel project is in the public_html. I am sharing a screenshot so that you guys can figure out the issue.
Here is the live of my website: https://kothay-jaben.com/
CodePudding user response:
To deploy your laravel project, you should leav the directory structure intact.
So, the project should not be inside public_html
.
Upload all files adn directories one level up (out side public_html
).
Then do one of the follwoing:
- copy/move files from
public
topublic_html
- Make a symlink from
public_html
CodePudding user response:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<Files .env>
Order allow,deny
Deny from all
</Files>