Skip to content

Instantly share code, notes, and snippets.

@aldhinya
Last active March 23, 2021 14:00
Show Gist options
  • Save aldhinya/399e47b45f62038457560a93b1cafdd2 to your computer and use it in GitHub Desktop.
Save aldhinya/399e47b45f62038457560a93b1cafdd2 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond $1 !^(index\.php|resources|robots\.txt|public)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^beritaku.rochman.id$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.beritaku.rochman.id$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>
Options -Indexes
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment