Skip to content

Commit 25d5b56

Browse files
committed
refractor: router entry point
1 parent d82a397 commit 25d5b56

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
RewriteEngine On
44
RewriteCond %{REQUEST_FILENAME} !-d
55
RewriteCond %{REQUEST_FILENAME} !-f
6-
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
6+
RewriteRule ^(.+)$ index.php?__url__=$1 [QSA,L]
77
</IfModule>

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#|==================================
99
#| Initialize the query string
1010
#|==================================
11-
$REQUEST_URI = $_SERVER['QUERY_STRING'] == '' ? ['index'] : explode('/', $_SERVER['REQUEST_URI']);
11+
$REQUEST_URI = $_SERVER['QUERY_STRING'] == '' ? ['index'] : explode('/', $_GET['__url__']);
1212
$REQUEST_DEPTH = count($REQUEST_URI);
1313

1414
#|==================================
@@ -17,7 +17,7 @@
1717
$destination_path = ENTRY_FOLDER;
1818
$current_type = 0; // 0 Folder | 1 File
1919
$is_not_found = false;
20-
for($r = ($_SERVER['QUERY_STRING'] == '') ? 0 : 2; $r < $REQUEST_DEPTH; $r++){
20+
for($r = 0; $r < $REQUEST_DEPTH; $r++){
2121
$part = $REQUEST_URI[$r];
2222
if( $part == '' ) continue;
2323

0 commit comments

Comments
 (0)