Skip to content

Commit fcbf686

Browse files
committed
Move static dir
1 parent 361f6d2 commit fcbf686

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
/public/_resources/
66
/.graphql-generated/
77
/public/_graphql/
8-
/data/cache
9-
/data/packages
10-
/data/versionmap.json
11-
/static/[0-9]
8+
/data/
129
.phpunit.result.cache

.htaccess

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
RewriteEngine On
22

3-
# If requested file is in the static folder, serve it
4-
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI} -f
5-
RewriteRule ^(.*)$ static/$1 [L]
3+
# If requested file is in the public/static folder, serve it
4+
# This file detection + redirect done here rather than public/.htaccess as redirect to public/$1 will mean
5+
# that %{REQUEST_URI} will change from something like /5/index.html to /public/5/index.html, which means
6+
# that we can no longer use %{REQUEST_URI} to check that a static file exists using -f because the file
7+
# is /public/static/5/index.html not /public/5/index.html
8+
9+
RewriteCond %{DOCUMENT_ROOT}/public/static/%{REQUEST_URI} -f
10+
RewriteRule ^(.*)$ public/static/$1 [L]
611

712
# Default
813
RewriteRule ^(.*)$ public/$1

.platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ php_settings:
66
shared_dirs:
77
mysite:
88
# persist the following directories between deployments
9-
data: {}
9+
# the static dir lives in the public dir, though do not need to specify "public/static" here
1010
static: {}
1111
crons:
1212
queuedjobs_task:

data/commited-file.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

doctum-conf/doctum.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"3": "3.x"
1010
},
1111
"paths": {
12-
"www": "static",
12+
"www": "public/static",
1313
"cache": "data/cache",
1414
"packages": "data/packages",
1515
"versionmap": "data/versionmap.json"

public/static/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+
!.htaccess

public/static/.htaccess

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file needs to be here in order for the redirect from the root .htaccess to work
2+
RewriteEngine On

static/.htaccess

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)