1

I created a content type. I have three fields: title, body, city.

I added two contents.

I can see nodes at:

http://www.example.com/?q=content/we-buy-houses-nj

http://www.example.com/?q=content/we-buy-houses-va

I created a view as following: I added title field first (excluded from display). I selected city field. For rewrite results, change the path to "content/[title]"

Result:

I can see the city field is hyperlinked. When I click each link, I get URL as following and page can not be found:

http://www.example.com/?q=content/We%20Buy%20Houses

http://www.example.com/?q=content/We%20Buy%20Houses

How do I remove the %20 so page can be found in my case?

enter image description here

2
  • Just a side note: You should enable clean urls by going to /admin/config/search/clean-urls. This will get rid off the ?q= part which is bad for SEO.
    – No Sssweat
    Jan 7, 2017 at 1:39
  • Thank you. It was a helpful tips. I just cleaned the urls. Now, I do not see ?q=.
    – autop
    Jan 7, 2017 at 19:54

1 Answer 1

2

You get %20 because the browser replaces/fixes/auto-corrects the empty space between your title with %20 as empty spaces are not allowed in URLs.

EX: If you try to go to drupal.org/Hello World, browser url changes/corrects it to drupal.org/Hello%20World.


Here is another possible option:

Add Path as a field, and checkmark exclude from display.

Make sure Content: Path is above Content: Cities, if not please re-arrange it.

Then in cities, for link path put [path]

0

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.