`{{url}}` helper shows incorrect url when subdirectory equals post slug
See original GitHub issueIssue Summary
If you create a post called /test/
. And you switch to a subdirectory called /test/
. Then the post should live at /test/test/
, but the {{url}}
helper displays /test/
.
I am pretty sure it’s caused by the deduplicate sub dir helper function, see.
This bug must exist for a while (since we introduced this function).
To Reproduce
- Create post with slug “test” (without subdirectory)
- Switch to subdirectory /test/
- Serve your blog and see that the post url is /test/
Solution
Write a test to proof this bug. Come up with an idea how to protect against this use case.
Technical details:
- Ghost Version: latest
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Custom Posts with same slug Redirecting to wrong post with ...
SO the issue arrise here whenever we try to access the first url it displays the template and content of 2nd url.The 2nd...
Read more >URL of subfolder site gives error when i change permalink ...
I have installed wordpress on my site subfolder https://learnforget.com/hindi/ . URL of the subfolder site works fine when i use default url but...
Read more >Get URL and URL Parts in JavaScript - CSS-Tricks
I want to redirect to the url(I'm trying to do it) after the equal to icon ! :-D. Please tell me the answer...
Read more >How to get URL of current page displayed?
Some pages (e.g. my homepage) display several posts, and if I use get_permalink() on these pages, the URL of the displayed page is...
Read more >WordPress Slugs: What They Are & How to Change Them
Usually, the culprit here is the URL slug. In this post, you'll learn what a slug in WordPress is and explore some best...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kirrg001 pull #9690 looks stale - I’m gonna pick this up 🛩️
@tiendq https://docs.ghost.org/docs/config#section-subpath - url configuration in your config file.