# 404 on Case Studies

I’ve been getting some 404 on case studies linked from Andy’s blog and from google.

http://mc-stan.org/documentation/case-studies/divergences_and_bias.html

but the actual URL is now:
http://mc-stan.org/users/documentation/case-studies/divergences_and_bias.html

It looks like all of these have moved - if you have access to the hosting, you can do something like this:
https://webmasters.stackexchange.com/questions/99288/htaccess-how-to-redirect-the-contents-of-a-directory-to-a-subdirectory

Which will make things easier for users find the case studies and keeps the old links from breaking.

+1 — I completely agree that we need them. @seantalts — did you add these or should I?

I think ideally we’d convince @betanalpha that we need them, but I tried already and it’s probably easier for me to just add redirects for the ones we know about.

If all of the case studies moved from documentation/case-studies to users/documentation/case-studies , you can use the wildcard and backreference from the stackexchange post to do them all at once.

I think we should redirect all the things that we can.

I just asked @betanalpha and he doesn’t mind if you add them, he just didn’t think it’d be worth the effort.

We’re not running our own webserver; we’re using Jekyll with github pages.

I’m adding the redirects, though I need to figure out how to redirect the html case studies.

I meant that convincing him would be ideal because we could just change the directory structure back to the old one for things like case studies and avoid some work.

That’s a different discussion. Let’s just go with the redirects.

I don’t mean the user-visible stuff, just the URLs.

That makes things harder, looks like you’d have to add the redirect plugin and then add a redirect-from on each page.

Yeah, that’s what I’m trying to script now. Turns out they also allow redirect_to, which we need for some of these where pages have been collated or are generated html.

Okay, think I got most of them: https://github.com/stan-dev/stan-dev.github.io/pull/41/files

Once this is merged, the links will work again.

+1

On another note, is there a reason that jquery is embedded in each of the case studies? It would load faster if it were sourced from a cdn.

I think those html files are just generated by whatever notebook program they’re using - maybe R Notebooks in R Studio? I don’t even see jquery in either of the case studies I looked at but I might be missing it - feel free to submit a pull request though. It’s also not obvious how we should be dealing with changes to generated files like this.

It’s the huge base64 data:application blob at the beginning of the source.

I’d be happy to submit a pull request. Where do those .html’s come from? Is there an Rmd source for each of them? It might be better to have them each in their own director with the Rmarkdown source, html file, generated images, pdf version etc.

I think @betanalpha knows more about how those are generated. It seems like the mechanism right now is to just stick the generated files up there and that there might not be a central repo for the Rmarkdown sources.

These html files come straight out of knitr. Please do not modify them by hand. If there are recommendations for customizing the knitr::render calls then feel free to share them in another thread.

My guess is that the jquery is there to enable mathjax support.