Last active
November 12, 2022 17:06
-
-
Save ahoNerd/06bc08be0087df0104875d02c7a8b69e to your computer and use it in GitHub Desktop.
Clean URL, read more at https://ahonerd.com/htaccess
This file contains 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
RewriteRule ^en$ /?&%{QUERY_STRING} | |
RewriteRule ^jp$ /?&%{QUERY_STRING} | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} /(.*)/$ | |
RewriteRule ^ /%1 [R=301,L] | |
RewriteRule ^en/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ /index.php?page=$1&sub=$2 [L,NC,QSA] | |
RewriteRule ^en/([a-zA-Z0-9-]+)$ /index.php?page=$1 [L,NC,QSA] | |
RewriteRule ^jp/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ /index.php?page=$1&sub=$2 [L,NC,QSA] | |
RewriteRule ^jp/([a-zA-Z0-9-]+)$ /index.php?page=$1 [L,NC,QSA] | |
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ /index.php?page=$1&sub=$2 [L,NC,QSA] | |
RewriteRule ^([a-zA-Z0-9-]+)$ /index.php?page=$1 [L,NC,QSA] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment