skip to Main Content

I have a domain let say xyz.com, and I have an internal URL like this, xyz.com/testUrl. I need to redirect this URL (xyz.com/testUrl) to another web site URL.(which is URL like this ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com:3001/employee).

Now, whenever someone hits xyz.com/testUrl , he should be redirected to ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com:3001/employee.

I am using goDadddy hosting.

2

Answers


  1. This will do the required work.

    @RequestMapping(value = "/xyz.com/testUrl", method = RequestMethod.GET)
    public ModelAndView method() {
        return new ModelAndView("ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com:3001/employee");
    }
    
    Login or Signup to reply.
  2. Just create .htaccess file in web root of xyz.com with content:

    Redirect 302 /testUrl xxx.compute-1.amazonaws.com:3001/employee
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search