Skip to content

Commit 2515b4c

Browse files
committed
rewrite
1 parent 3564012 commit 2515b4c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

public/.htaccess

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<IfModule mod_rewrite.c>
22
RewriteEngine On
33

4-
# 0) Let real files/dirs pass through
5-
RewriteCond %{REQUEST_FILENAME} -f [OR]
6-
RewriteCond %{REQUEST_FILENAME} -d
7-
RewriteRule ^ - [L]
4+
85

96
# 1) If a directory-style path has an index.html, serve it
107
# (works for any depth, with or without a trailing slash)
118
RewriteCond %{REQUEST_FILENAME}/index.html -f
129
RewriteRule ^(.+?)/?$ $1/index.html [L]
1310

11+
# 0) Let real files/dirs pass through
12+
RewriteCond %{REQUEST_FILENAME} -f [OR]
13+
RewriteCond %{REQUEST_FILENAME} -d
14+
RewriteRule ^ - [L]
15+
1416
# 2) Canonicalize: if index.html exists but URL lacks trailing slash, redirect to add it
1517
RewriteCond %{REQUEST_FILENAME} !-f
1618
RewriteCond %{REQUEST_FILENAME}/index.html -f

0 commit comments

Comments
 (0)