0

If I insert an external Wikipedia URL in an 's href-attribute (let's say https://de.wikipedia.org/wiki/Foo (without trailing slash)), it redirects me to https://de.wikipedia.org/wiki/Foo/ (with trailing slash).

Unfortunately Wikipedia pages seem not to be reachable with a trailing slash, so I always refer to a 404 page when I try to link a Wikipedia page.

I'm not sure if the automated trailing slash adding is a Wordpress core functionality or if it's done by a plugin.

I'm looking for a way to either turn that functionality off completely, or just for wikipedia.org.

Froxx
  • 957
  • 4
  • 14
  • 27
  • lets see your code. – delboy1978uk Sep 12 '17 at 13:01
  • 1
    That doesn't seem like a problem that needs code imo. I simply add a link by 's href in my post content. Nothing more. – Froxx Sep 12 '17 at 13:04
  • 1
    @delboy1978uk obviously they don't know if the code to add that trailing slash exists, how in the world would they share it?!! – Sheedo Sep 12 '17 at 13:04
  • if it's not hard coded with a slash, then where is it coming from? we can look in wordpresses code if it's some WP function call – delboy1978uk Sep 12 '17 at 13:08
  • @delboy1978uk That's exactly what I want to know. Is that a wordpress functionality? If yes, can I turn it off? If no, is it done by a plugin anyone knows about? – Froxx Sep 12 '17 at 13:10
  • right, so clarify for me, are you putting a hard coded url in your html? you aren't calling anything? – delboy1978uk Sep 12 '17 at 13:11
  • 1
    Are you using the yoast SEO plugin? There is a setting under Advanced > Permalinks that forces a trailing slash onto URLs. I'd try looking at that first. – delboy1978uk Sep 12 '17 at 13:11
  • 1
    OR, it could be your .htaccess, look here https://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url – delboy1978uk Sep 12 '17 at 13:13
  • Are you adding the link directly in the text editor of your post? If so, I doubt it's a WordPress functionality. I just tried it on my site and no slash got added. – Sheedo Sep 12 '17 at 13:13
  • 1
    Wordpress doesn't add a trailingslah in the links from the Post Editor. It must be either your htaccess or a plugin. – Awais Umar Sep 12 '17 at 13:16
  • I knew about the option in YOAST, but I'm using All In One SEO and didn't find a similar option. It also doesn't seem like there is something in my .htaccess causing that error. I'll try to find out if a plugin is causing that behavior. – Froxx Sep 12 '17 at 13:28
  • Alright, it was actually a plugin causing that. Thanks for your help. – Froxx Sep 12 '17 at 15:10
  • What plugin, if you don't mind sharing? – Sheedo Sep 12 '17 at 18:04
  • @Sheedo, it wasn't unreasonable for delboy1978uk to ask for code... this is a site for coding issues after all, and the question doesn't meet SO guidelines - it is too broad and it gave no indication of any research on the OP's part (see [How much research effort is expected of Stack Overflow users](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users#261593) ). While we appreciate that some people don't know where to start to look for an issue, SO is not always the place for those questions. – FluffyKitten Sep 12 '17 at 18:20
  • @FluffyKitten I get that, but what kind of code would make sense in this case? If they mentioned something about meeting SO guidelines like you just did, that would've been a totally different story (and I try to leave these to mods and more experienced users), but they simply asked for code which in my opinion wouldn't have added to the question any clarity. – Sheedo Sep 12 '17 at 18:55
  • @Sheedo No it probably wouldn't help in this case, but the OP did tag the question as PHP, and many PHP developers (as delboy1978uk is, based on their profile) don't understand WP and how you can set up a site without seeing a line of code. I'm not saying the way delboy1978uk did it was right, but all too frequently we have to prompt people to show their code when it is clearly *necessary*, so I understand the frustration of review questions where so many people have put no effort in asking their question never mind solving it. :) – FluffyKitten Sep 12 '17 at 19:21
  • @Sheedo It wasn't a public plugin but a one a coworker developed a long time ago – so it's nothing I could help others in future unfortunately. – Froxx Sep 13 '17 at 10:02
  • I see. Thank you. – Sheedo Sep 13 '17 at 10:25

0 Answers0