I'm curious if anyone else has run into this: Any redirect with an ampersand (&) in the "from" field will fail for me. I've never noticed this before, but I've probably never used a redirect with an ampersand before.

Specifically, what happens is that the redirect is successfully saved, but if you visit the URL with the ampersand, you get a page not found.

I'm open to the possibility that it's something specific to this site that is causing the ampersands to fail, so if no one else can reproduce this, I'll close the issue. I'm going to try it on a few other sites as well.

CommentFileSizeAuthor
#1 1289052-1.redirect-with-ampersand.png28.24 KBdww

Comments

dww’s picture

Project: Path redirect » Redirect
Version: 6.x-1.0-rc2 » 7.x-1.x-dev
StatusFileSize
new28.24 KB

I'm having this problem on a D7 site that just went live:

http://isreview.org/issues/82/rev-magdoff&foster.shtml

is a 404

http://isreview.org/issues/82/rev-magdoff%26foster.shtml

(with the & urlencoded) works fine and redirects you here:

http://isreview.org/issue/82/economic-roots-environmental-crisis

I had added both to try to work-around this problem, but the original ampersand URL that people are actually trying to use is still failing. I definitely can't add the one with the ampersand since it's already there:

screenshot of redirects to the story

Interesting data point: these redirects work on my local dev environment (laptop running apache) but fail on the live site (hosted at Pantheon, using nginx). So maybe it's something getting encoded via nginx that confuses what redirect is seeing/doing.

So I think this is still a valid bug report. Moving it to the queue/version where I suspect it'll get more attention. ;)

If I dig deeper and debug it, I'll definitely post info (and hopefully a patch) here.

Cheers,
-Derek

dww’s picture

Category: bug » support
Status: Active » Closed (works as designed)

More data - in this case, nginx is clearly trying to interpret the & as part of a query string, not noticing that a ? hadn't yet appeared. Behold:

http://isreview.org/issues/78/feat-marxism&unions.shtml

That used to also be a 404. I added a redirect from issues/78/feat-marxism to issue/78/marxism-unions-and-class-struggle

and now the above link sends you here:

http://isreview.org/issue/78/marxism-unions-and-class-struggle?unions_sh...

So, I just need to add redirects from all the paths that include & with just the part preceding the &.

Wonder if that was the same problem rootwork was having...

Seems like this could be a server config issue and not actually a bug.

Cheers,
-Derek