phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

[phet-io 2.1.11-rc.1] dev link on wrapper index broken #262

Closed zepumph closed 5 years ago

zepumph commented 5 years ago

From https://github.com/phetsims/QA/issues/187

I am finding some weird logic with the devguide for this version.

You can get to it via https://phet-dev.colorado.edu/html/forces-and-motion-basics/2.1.11-rc.1/wrappers/index/

When you do so, it redirects you to "https://phet-dev.colorado.edu/guide.html" which is not a file. I see that it works in the previous version: https://phet-io.colorado.edu/sims/forces-and-motion-basics/2.1.10-phetio/docs/devguide.html

When I curl -v https://phet-dev.colorado.edu/html/forces-and-motion-basics/2.1.11-rc.1/docs/devguide.html, I get that it has moved to "https://phet-dev.colorado.edu/guide.html" which doesn't exist.

I CAN recreate this problem in the last rc on phet-dev that 2.1.10 went through: https://phet-dev.colorado.edu/html/forces-and-motion-basics/2.1.10-rc.1/wrappers/index/

@mattpen is it possible that there is a weird redirect rule in place for some reason on this server? Perhaps something to do with the "dev" keyword?

zepumph commented 5 years ago

This is not a high priority to me because it doesn't look like it will effect production, and it won't effect the upcoming study.

mattpen commented 5 years ago

@zepumph - I think this line is missing a ^ to match the beginning of the string:

RewriteRule "/dev(.*)" "$1" [L,R=301,NE]

It should be:

RewriteRule "^/dev(.*)" "$1" [L,R=301,NE]

I'll make this change and deploy it tonight after the scheduled cache server reboot.

zepumph commented 5 years ago

Ahh I see. Yes sounds like a good fix.

zepumph commented 5 years ago

Also maybe a slash after 'dev'?

mattpen commented 5 years ago

Also maybe a slash after 'dev'?

Should we then add a rule rewriting /dev -> /?

i.e.

RewriteRule "^/dev$" "/" [L,R=301,NE]
RewriteRule "^/dev(.*)" "$1" [L,R=301,NE]
zepumph commented 5 years ago

Couldn't you away with a single rule like (untested) RewriteRule "^/dev(/.*)" "$1" [L,R=301,NE]

mattpen commented 5 years ago

Couldn't you away with a single rule like (untested) RewriteRule "^/dev(/.*)" "$1" [L,R=301,NE]

Indeed we can. It should be working now. Please close if all looks good @zepumph.

zepumph commented 5 years ago

That's great thanks! Just a note that the previous 301 is a very stubborn redirect that is cached permanently, so you need to open dev tools or something if testing this when you have already been to that link. Closing