Skip to content

Commit

Permalink
docs(pgs): Redirects have to start with /, http, or https (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-chaffee authored Nov 12, 2024
1 parent 77734fd commit 1b27b02
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions posts/pgs.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ We have a very easy-to-setup guide on [custom domains](/custom-domains#pgssh).

We support custom redirects and rewrites via a special file `_redirects`.

> The `_redirects` filesize cannot exceed 5kb.
> The `_redirects` file size cannot exceed 5KB.
```
# Redirect browser request to what we serve
Expand Down Expand Up @@ -220,15 +220,17 @@ override this preference by adding a force flag to your redirect entry:
/space / 301!
```

## Redirect `www` to naked domain
## Redirect `www` to apex domain

Our recommended solution is to create a separate project with just a
A common requirement is to redirect "www.example.com" to the apex domain "example.com" or the other way around.

To accomplish this, we recommend you create a separate project with just a
`_redirects` file inside of it.

1. Create a `_redirects` file with a `301` to naked domain:
1. Create a `_redirects` file with a `301` to the apex domain:

```bash
echo "/* naked-domain.com/:splat 301" >> _www_redirects
echo "/* https://example.com/:splat 301" >> _www_redirects
rsync "$PWD/_www_redirects" pgs.sh:/www-proj/_redirects
```

Expand Down Expand Up @@ -287,7 +289,7 @@ will let you use `/api/` from your JavaScript client:

We support custom headers via a special file `_headers`.

> The `_headers` filesize cannot exceed 5kb.
> The `_headers` file size cannot exceed 5KB.
```
# a path:
Expand Down

0 comments on commit 1b27b02

Please sign in to comment.