Skip to content

Commit

Permalink
refactor(htaccess): streamline URL rewriting and remove unused index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
0x1026 committed Nov 9, 2024
1 parent bc99abf commit 1fc8fda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/.htaccess
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteEngine On

RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-l
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
1 change: 0 additions & 1 deletion src/index.php

This file was deleted.

8 changes: 8 additions & 0 deletions src/public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RewriteEngine On

# Allow access to real files and directories (CSS, JS, images, etc.)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Forward all other requests to index.php
RewriteRule ^ index.php [QSA,L]

0 comments on commit 1fc8fda

Please sign in to comment.