Routing
/dashboard/settings/routing
Routing settings customize the URLs of your content: the path used for users, images, videos and albums, which content type is served at the website root, and whether image and album URLs include their title.
Pro feature
Routing is available in Chevereto Pro. If CHEVERETO_ENABLE_ROUTING is set to 0, the user, image and album routes and the root routing use their defaults, whatever is set here. If CHEVERETO_ENABLE_SEO_IMAGE_URL or CHEVERETO_ENABLE_SEO_ALBUM_URL is set to 0, the matching SEO URLs are always disabled. See Toggles.
How routes work
Each content type is served under its own route, the first part of the URL path. For example, with the image routing set to i, an image is served at /i/<id> instead of /image/<id>.
When a route is customized, requests to its default route are redirected (301) to the new one, so /image/<id> redirects to /i/<id>. This keeps existing links working after the change.
WARNING
Only the default routes (user, image, video and album) redirect. If you change a route from one custom value to another, such as from i to pic, links using the old custom value (/i/<id>) stop working.
Route values follow these rules:
- Only lowercase letters (
a-z), numbers (0-9), hyphens (-) and underscores (_) are allowed. - A route can't start or end with a hyphen or underscore, and can't have two of them in a row, so
my-imagesis valid but-images,images_andmy--imagesaren't. - Each route must be different from the others.
DANGER
Don't use the name of a built-in route, such as explore, upload, search, page, login, settings or dashboard, or the default name of another content type (for example album for images). Built-in routes take precedence, so content under that route can't be reached.
User routing
Determines the route for user profiles, served at /user/<username> by default.
| Type | Examples |
|---|---|
| String | user, u |
Default: user.
User profiles are served at the root (/<username>) by default, as the root routing is User. In that case, this route is only used to redirect /user/<username> to /<username>.
Image routing
Determines the route for images, served at /image/<id> by default.
| Type | Examples |
|---|---|
| String | image, i |
Default: image.
Video routing
Determines the route for videos, served at /video/<id> by default.
| Type | Examples |
|---|---|
| String | video, v |
Default: video.
Album routing
Determines the route for albums, served at /album/<id> by default.
| Type | Examples |
|---|---|
| String | album, a |
Default: album.
Root routing
Determines which content type is served at the website root, without its route.
| Value | Effect |
|---|---|
| User | User profiles are served at /<username> (default) |
| Album | Albums are served at /<id> |
| Image | Video | Images and videos are served at /<id> |
The other content types keep their route. For example, with Album selected, albums are served at /<id> while user profiles move to /user/<username>.
Requests that include the route of the root content type are redirected (301) to the root URL, so with Album selected, /album/<id> redirects to /<id>.
WARNING
Changing the root routing changes the URL of existing content. Links that used the old root URL, such as /<username> after moving away from User, stop working.
TIP
The website root itself (/) is set by the homepage settings. In single profile website mode, the profile URL is set by single profile routing.
SEO image URLs
Toggles adding the title to image and video URLs.
| Value | Effect |
|---|---|
| Enabled | URLs include the title, like /image/image-title.<id> (default) |
| Disabled | URLs contain only the ID, like /image/<id> |
In the title, spaces are replaced by hyphens, the characters \ / ~ & ! ' " ? are removed, and other characters are URL encoded. Content without a title uses the ID-only URL.
Only the ID (the part after the last .) is used to find the content, so both URL styles always work. You can toggle this setting without breaking existing links, and editing a title doesn't break them either.
The short URL shown for each image and video always uses the ID-only format.
SEO album URLs
Toggles adding the album name to album URLs.
| Value | Effect |
|---|---|
| Enabled | URLs include the name, like /album/album-name.<id> (default) |
| Disabled | URLs contain only the ID, like /album/<id> |
The album name is converted the same way as image titles, and both URL styles always work.
