Skip to main content
title spelling
Source Link
Marion Newlevant
  • 12.1k
  • 1
  • 23
  • 55

Prevent Craft URLs containgcontaining # from redirecting

I have a Structure setup where I'd like each child to link to aan anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/website-design

How can I prevent this from happening?

Prevent Craft URLs containg # from redirecting

I have a Structure setup where I'd like each child to link to a anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/website-design

How can I prevent this from happening?

Prevent Craft URLs containing # from redirecting

I have a Structure setup where I'd like each child to link to an anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/website-design

How can I prevent this from happening?

Craft actually redirects to child slug, not parent slug.
Source Link
cmal
  • 815
  • 4
  • 14

I have a Structure setup where I'd like each child to link to a anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/web-interactivewebsite-design

How can I prevent this from happening?

I have a Structure setup where I'd like each child to link to a anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/web-interactive-design

How can I prevent this from happening?

I have a Structure setup where I'd like each child to link to a anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/website-design

How can I prevent this from happening?

Source Link
cmal
  • 815
  • 4
  • 14

Prevent Craft URLs containg # from redirecting

I have a Structure setup where I'd like each child to link to a anchor within the parent page (see the attached image).

enter image description here

But when I use <a href="{{ subEntry.url }}"> and click on the link, it redirects to the parent URL without the # anchor.

e.g. http://localhost:3000/services/web-interactive-design#website-design redirects to http://localhost:3000/services/web-interactive-design

How can I prevent this from happening?