4

Using Drupal 8

I need to set various links between my content types and so far I'm setting the link using their path-auto-generated-alias, but that's terrible practice because if I change the pattern one day I will have to change every single existance of the out of date url alias.

I've seen plenty of answers for Drupal 7 with module Global Redirect but it states that it's deprecated for Drupal 8 and to use Redirect instead. I installed the module and I'm presented with this:

enter image description here

I have no idea what's amitted in there, tokens? If someone could direct me to a documentation where I can learn to use the module I'd really appreciate it since I'm at a loss.

The reason why I'm in that part is because I have the following Global Settings and it's not redirecting /node/id to expected Path Auto URL alias.

enter image description here

1 Answer 1

4

Found my mistake, you can't have Check access to the redirected page enabled in the global REDIRECTS.

enter image description here

4
  • 1
    if your nodes are published and accessible then it should still work with the access check. I also don't fully get what you're doing with links. Drupal should be able to generate the correct link in most cases, be it an entity reference field, a link field. This should only come in to play if someone manually goes to node/1, links on the page should use the correct alias, as you otherwise have a redirect which makes it slower. If you have links inside body fields, have a look at pathologic, that might help.
    – Berdir
    Commented Nov 13, 2016 at 13:29
  • I wanted to have the Global Redirects because sometimes (not always) in the body of my nodes I like to link to other nodes, and when inserting that link in the body I use the target node's PathAuto generated URL. Toady I realized that if I were to change that target node's URL Pattern in PathAuto ( say instead of /story/this-is-it to story/funny/this-is-it ) then I'd have to manually change the link I used in the body. But if I place the link with node/id then thanks to Global Redirect, I won't have to worry about it.
    – Chayemor
    Commented Nov 13, 2016 at 22:43
  • 1
    Yes, you can either use pathologic, which will display the correct alias already and if you are using redirect and pathauto, then redirect will also automatically register a redirect for the old alias anyway.
    – Berdir
    Commented Nov 13, 2016 at 23:49
  • I am using Redirect to display the alias if it exists, but it won't work unless I uncheck the "Check access to the redirected page" for some reason.
    – Chayemor
    Commented Nov 15, 2016 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.