-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
27 lines (21 loc) · 889 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
RewriteEngine on
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Set the base directory to /plugins
RewriteBase /plugins/
# Redirect server errors to the custom error page (adjust the path as needed)
ErrorDocument 404 /plugins/404.html
# Try to serve file, folder, or default to 404.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/plugins/404.html
RewriteRule ^(.*)$ $1.html [L]
RewriteRule ^(.*)/$ $1 [L]
# If the blog is also under /plugins, adjust the rule accordingly
# Rewrite /plugins/blog/something to /plugins/blog/something.html
# Adjust the rule if your blog is located elsewhere
RewriteRule ^blog/(.+)$ blog/$1.html [L]
# Ensure internal requests for 404.html do not result in a redirect loop
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^404\.html$ - [L]