Created
July 12, 2024 04:01
-
-
Save labibmuhajir/3c6d83865209d324d61db761e84fa0bc to your computer and use it in GitHub Desktop.
2 htaccess php cpanel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# htdocs/ | |
# ├─ public/ | |
# │ └─.htaccess //second file | |
# │ | |
# ├─ src/ | |
# └─.htaccess //first file | |
# first .htaccess in root host folder | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC] | |
RewriteRule ^ %1 [L,NE,R=302] | |
RewriteRule ^((?!public/).*)$ public/$1 [L,NC] | |
# second .htaccess in public folder | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php?$1 [L,QSA] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment