Skip to content

Instantly share code, notes, and snippets.

@ErMandeep
Created July 19, 2021 17:45
Show Gist options
  • Save ErMandeep/b2e526f9267bc5291f141114f50b83f8 to your computer and use it in GitHub Desktop.
Save ErMandeep/b2e526f9267bc5291f141114f50b83f8 to your computer and use it in GitHub Desktop.
ionse de .htaccess file
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
@ErMandeep
Copy link
Author

add .htaccess in public folder
.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # 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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment