Skip to content

Commit f4fefec

Browse files
committed
fix bad redirects
1 parent ca7d0a2 commit f4fefec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

scripts/create-redirect.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ if [ "$#" -ne 3 ]; then
88
exit 1
99
fi
1010

11+
DESTINATION_FOLDER="docs-preview"
12+
1113
BUCKET_NAME="$1"
1214
OLD_PATH="$2" # must include leading and trailing slash e.g. /about-circleci/
13-
NEW_PATH="$3" # full target path e.g. /docs-preview/guide/about-circleci/index.html
15+
NEW_PATH="/${DESTINATION_FOLDER}$3" # full target path e.g. /docs-preview/guide/about-circleci/index.html
1416

1517
echo "[INFO] Deploying redirect to bucket: s3://$BUCKET_NAME"
1618
echo "[INFO] Redirect: $OLD_PATH -> $NEW_PATH"
1719

1820
# Convert old path to S3 key (no leading slash before key!)
19-
S3_KEY="docs-preview${OLD_PATH}index.html"
21+
S3_KEY="${DESTINATION_FOLDER}${OLD_PATH}index.html"
2022

2123
echo "[INFO] Creating S3 object: $S3_KEY"
2224

scripts/redirects_v2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# Total redirects: 502
44

55
- old: /about-circleci/
6-
new: /guides/about-circleci/about-circleci/index.html
6+
new: /guides/about-circleci/index.html
77

88
- old: /add-ssh-key/
9-
new: /guides/integration/add-ssh-key/index.html
9+
new: /guides/integration/add-ssh-key.html
1010

1111
- old: /android-images-support-policy/
1212
new: /guides/execution-managed/android-images-support-policy/index.html

0 commit comments

Comments
 (0)