From 4c96327e10ca603271073b48b72c5a1902daca19 Mon Sep 17 00:00:00 2001 From: React More Date: Tue, 23 Jul 2024 19:15:53 +0700 Subject: [PATCH 1/2] Refactor directory structure and update script paths (#1) * delete index.php on root folder * Edit .htaccess rules in root folder * Revert code Block Access * Update script paths in views templates - Updated script paths in template files within the views folder - Changed paths from public/assets to assets to reflect new directory structure --- .htaccess | 61 +++---------------- app/Views/admin/dashboard.php | 2 +- .../admin/generate-laporan/laporan-guru.php | 2 +- .../admin/generate-laporan/laporan-siswa.php | 2 +- app/Views/scan/scan.php | 6 +- app/Views/templates/css.php | 8 +-- app/Views/templates/fixed_plugin.php | 8 +-- app/Views/templates/js.php | 14 ++--- app/Views/templates/sidebar.php | 2 +- app/Views/templates/starting_page_layout.php | 2 +- index.php | 56 ----------------- public/assets/fonts/fonts.css | 14 ++--- 12 files changed, 39 insertions(+), 138 deletions(-) delete mode 100644 index.php diff --git a/.htaccess b/.htaccess index 3388e4b..79a9b1b 100644 --- a/.htaccess +++ b/.htaccess @@ -1,61 +1,18 @@ -# Disable directory browsing -Options All -Indexes - -# ---------------------------------------------------------------------- -# Rewrite engine -# ---------------------------------------------------------------------- - -# force HTTPS -# RewriteCond %{HTTPS} !on -# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} - -# -# Header always set Strict-Transport-Security "max-age=31536000;includeSubDomains" -# - -# Turning on the rewrite engine is necessary for the following rules and features. -# FollowSymLinks must be enabled for this to work. - Options +FollowSymlinks - RewriteEngine On - - # If you installed CodeIgniter in a subfolder, you will need to - # change the following line to match the subfolder you need. - # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase - # RewriteBase / + RewriteEngine On - # Redirect Trailing Slashes... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_URI} (.+)/$ - RewriteRule ^ %1 [L,R=301] + RewriteCond %{REQUEST_FILENAME} -d [OR] + RewriteCond %{REQUEST_FILENAME} -f + RewriteRule ^ ^$1 [N] - # Rewrite "www.example.com -> example.com" - RewriteCond %{HTTPS} !=on - RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] - RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + RewriteCond %{REQUEST_URI} (\.\w+$) [NC] + RewriteRule ^(.*)$ public/$1 - # Checks to see if the user is attempting to access a valid file, - # such as an image or css document, if this isn't true it sends the - # request to the front controller, index.php - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA] - - # Ensure Authorization header is passed along - RewriteCond %{HTTP:Authorization} . - RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - - - - # If we don't have mod_rewrite installed, all 404's - # can be sent to index.php, and everything works as normal. - ErrorDocument 404 index.php + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php -# Disable server signature start - ServerSignature Off -# Disable server signature end - # block access RedirectMatch 403 .env RedirectMatch 403 .gitattributes diff --git a/app/Views/admin/dashboard.php b/app/Views/admin/dashboard.php index 20f8ffd..e18cc31 100644 --- a/app/Views/admin/dashboard.php +++ b/app/Views/admin/dashboard.php @@ -177,7 +177,7 @@ - + - + + - - - + + + + - + - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/templates/sidebar.php b/app/Views/templates/sidebar.php index 7eedbab..8fc8716 100644 --- a/app/Views/templates/sidebar.php +++ b/app/Views/templates/sidebar.php @@ -20,7 +20,7 @@ break; } ?> -