Skip to content

Commit

Permalink
[experiments] Handle redirects for Twizzle app URLS.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jul 22, 2021
1 parent 9fe0a6c commit f1b28ff
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 28 deletions.
64 changes: 39 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"peggy": "^1.1.0",
"prettier": "^2.2.1",
"puppeteer": "^8.0.0",
"snowpack": "^3.8.0-pre.0",
"snowpack": "^3.8.3",
"ts-jest": "^27.0.3",
"typescript": "^4.3.2",
"yargs": "^16.2.0"
Expand Down
10 changes: 8 additions & 2 deletions snowpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export const sitesSnowpackConfig = {

export const twizzleSnowpackConfig = {
mount: {
"src/sites/alpha.twizzle.net": { url: "/" },
"src/sites/alpha.twizzle.net": {
url: "/",
dot: true, // for .htaccess
},
},
buildOptions: {
out: "dist/sites/alpha.twizzle.net",
Expand All @@ -57,7 +60,10 @@ export const twizzleSnowpackConfig = {

export const experimentsSnowpackConfig = {
mount: {
"src/sites/experiments.cubing.net/cubing.js": { url: "/" },
"src/sites/experiments.cubing.net/cubing.js": {
url: "/",
dot: true, // for .htaccess
},
},
buildOptions: {
out: "dist/sites/experiments.cubing.net/cubing.js",
Expand Down
3 changes: 3 additions & 0 deletions src/sites/experiments.cubing.net/cubing.js/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Header set Cache-Control "max-age=300; must-revalidate"
# This might be redundant, but just to be sure:
ExpiresActive On
ExpiresDefault A300

Redirect 307 /cubing.js/twizzle/ https://alpha.twizzle.net/explore/
Redirect 307 /cubing.js/alg.cubing.net/ https://alpha.twizzle.net/edit/

0 comments on commit f1b28ff

Please sign in to comment.