Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

URL Redirects: Some work, Others Do Not

Started by bodigiti 7 years ago · 3 replies · 447 views
7 years ago

Some site URL redirects work, and others do not. Can you help me understand this?
http://earthsourcejax.com
Redirects are added in: site.yaml
Attempted to resolve by commented/uncommented all items in .htaccess but no joy.

Example of a redirect that does not work:
FROM /decorative-rock-and-gravel/eastern-sunrise-gravel
TO /products/rock-gravel
But instead of redirecting to: /products/rock-gravel
It redirects to: /products/rock-gravel/eastern-sunrise-gravel
Which is a combination of the TO url /products/rock-gravel
...followed by the END of the FROM url /eastern-sunrise-gravel(edited)

Example of redirects that do work
FROM /wall-stone --> TO /products/wall-stone
FROM /portfolio/wall-stone --> TO /products/wall-stone


Contents of /user/config/site.yaml

YAML
title: 'Landscape Design & Supply, Hardscapes, Waterscapes, & Natural Stone Ponds | Earth Source Jacksonville, FL'
default_lang: en
author:
  name: author
  email: a[email protected]
taxonomies:
  - category
metadata:
  description: 'Earth Source is a landscaping supplier, plant and tree nursery and natural stone pond engineers'
summary:
  enabled: false
  format: short
  size: 300
  delimiter: '==='
redirects:
  /shop: /
  /soils: /products/soil
  /garden-steppers: /products/garden-steppers
  /boulders: /products/boulders
  /wall-stone: /products/wall-stone
  /flagstone: /products/flagstone
  /mulches: /products/mulch
  /contact-us: /contact
  /category/products: /
  /author/beckyadmin: /
  /boulders/earthsource12: /products/boulders
  /flagstone/earthsource20: /products/flagstone
  /portfolio/wall-stone: /products/wall-stone
  /mulches/mulch-gold: /products/mulch/golden-mulch
  /mulches/mulch-pinenuggets: /products/mulch/pine-bark-nuggets
  /soils/soil-top: /products/soil/top-soil
  /flagstone/sandstone-select: /products/flagstone
  /flagstone/stone-pinola-2: /products/flagstone/pinola-flagstone
  /decorative-rock-and-gravel: /products/rock-gravel
  /flagstone/stone-palomino-2: /products/flagstone
  /flagstone/arkansas-sebastian-patio: /products/flagstone
  /flagstone/quartzite-blue-mica: /products/flagstone
  /flagstone/stone-irregular-bluestone: /products/flagstone
  /flagstone/quartzite-cayon-gold: /products/flagstone
  /decorative-rock-and-gravel/scrap-rock: /products/rock-gravel
  /decorative-rock-and-gravel/rock-rarered: /products/rock-gravel
  /decorative-rock-and-gravel/rock-coloradosun: /products/rock-gravel/colorado-sunrise-gravel
  /decorative-rock-and-gravel/rock-honeycutt: /products/rock-gravel
  /decorative-rock-and-gravel/rock-67-stone: /products/rock-gravel
  /decorative-rock-and-gravel/rock-pea-gravel: /products/rock-gravel/pea-river-rock-gravel
  /decorative-rock-and-gravel/eastern-sunrise-gravel: /products/rock-gravel
  /decorative-rock-and-gravel/crushed-coquina-gravel: /products/rock-gravel
  /decorative-rock-and-gravel/salt-pepper-granite: /products/rock-gravel
  /decorative-rock-and-gravel/black-lava-rock: /products/rock-gravel
  /decorative-rock-and-gravel/pink-granite-gravel: /products/rock-gravel
  /decorative-rock-and-gravel/gray-variegated-granite-gravel: /products/rock-gravel
blog:
  route: /blog
last edited 02/21/19 by bodigiti
7 years ago

Other than single-quoting the key and value of redirects, there is nothing the matter with the above. Keep in mind, the redirect only works when there is no Page where the page redirects from. So user/pages/decorative-rock-and-gravel/eastern-sunrise-gravel must not exist.

7 years ago

1) Correct, this page does not exist: /decorative-rock-and-gravel/eastern-sunrise-gravel
It existed on the old website. How do you recommend I fix this without creating a dummy page?

2) However, the following pages also do not exist but the redirects work:

a. /wall-stone (this page does not exist, however, /portfolio/wall-stone does exist, not sure why this redirect works.

b. /portfolio/wall-stone ... for this url a page of /portfolio exists, so apparently it is making a connection of replacing /portfolio with /products and the redirect works because the second part of the url is the same from the old site to the new as '/wall-stone' so it worked.

7 years ago

What does your /user/pages-structure look like? Could you give an overview of what Pages are there? I don't see any immediate pattern in the redirects that would cause varying results.

Could you also detail your server-setup further? Ie., what is the path the site is served from, does it use a subfolder- or subdomain-setup, how is .htacces or other equivalent set up.

Might also be helpful to see system.yaml, especially in regards to absolute URLs.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago