Skip to content

Commit

Permalink
feat: update htaccess
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysinku committed Jun 15, 2024
1 parent ac14bbd commit c3ee4da
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:hY1meFZugvDqmJ87X+1UPwI/ne5suBnMhcjm0Pu7cAo=
APP_KEY=base64:17mss5We3rWBOzyy+ZioM+Qa4eivOT+vLC3buxhq0+k=
APP_DEBUG=true
APP_URL=http://localhost/6969

Expand Down
16 changes: 11 additions & 5 deletions public/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@
<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_URI} !^/api
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

# Send Requests To API Front Controller...
RewriteRule ^.*$ index.php [L]

# RewriteRule ^api/.*$ /api/index.php [L]
</IfModule>
21 changes: 21 additions & 0 deletions public/bak.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<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>
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"env": {
"APP_ENV": "production",
"APP_DEBUG": "true",
"APP_URL": "https://yourprojectdomain.com",
"APP_KEY": "base64:17mss5We3rWBOzyy+ZioM+Qa4eivOT+vLC3buxhq0+k=",

"APP_CONFIG_CACHE": "/tmp/config.php",
"APP_EVENTS_CACHE": "/tmp/events.php",
Expand Down

0 comments on commit c3ee4da

Please sign in to comment.