0

I want to redirect to website "www.xxx.com" when access to localhost:9000.

environment is scala and play-framework.

routes file setting is below

 GET        /                      controllers.HomeController.index

controllers

package controllers

import javax.inject.Inject
import play.api.mvc._

/**
  * A very small controller that renders a home page.
  */
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {

  def index = Action { implicit request =>
    Ok(views.html index())
  }
}

This is the screenshot: localhost:9000. localhost:9000 image

How to redirect to "www.xxx.com" when access to localhost:9000?             please advice me.

donuts
  • 1
  • 2

1 Answers1

0

I think you should be doing this one for redirect on your route.

controllers.Default.redirect(to = "http://www.google.com")
Shankar Shastri
  • 1,134
  • 11
  • 18