Back to Frontend

Redirects.Scala

admin/app/views/redirects.scala.html

latest1.2 KB
Original Source

@(form: play.api.data.Form[controllers.admin.PageRedirect], urlMsgs: List[String] = List.empty, fileMsgs: List[String] = List.empty)(implicit request: RequestHeader, context: model.ApplicationContext) @admin_main("Redirector", isAuthed = true) {

  • This will only add the redirect to Next Gen Web. It will not add it to R2 (classic/desktop site) or mobile apps.
  • This tool can only insert redirects for URLs that do not already exist. (i.e. the current url must 404). Redirects for things that exist will not work (this also means you cannot accidentally redirect the /sport page).
  • Use full URLs like https://www.theguardian.com/somewhere/something
  • Do not include query parameters (e.g. "?CMP=custom_campaign_code") in the From field.
  • To delete a redirect fill in the From field and leave the To field empty.
  • You can only redirect a single page. (you cannot redirect everything under /water)
  • If your redirect does not work immediately give it a few minutes to work its way through the cache.

Redirect: From:

To:

@if(urlMsgs.nonEmpty) {

@urlMsgs.mkString

} Redirect a batch of URLs from a tab-separated file (fromUrl\ttoUrl\r\n): File:

@if(fileMsgs.nonEmpty) {

@fileMsgs.mkString

} }