skip to Main Content

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.

enter image description here

Here is the live of my website: https://kothay-jaben.com/

3

Answers


  1. <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    
    <Files .env>
    Order allow,deny
    Deny from all
    </Files>
    
    Login or Signup to reply.
  2. 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:

    1. copy/move files from public to public_html
    2. Make a symlink from public_html
    Login or Signup to reply.
  3. .htaccess files usually go into the ‘public’ folder of laravel app. Try moving that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search