I have application in GAE/J and my application url’s are indexed in google as follows –
http://myapp.appspot.com/view/121200/this-is-test/
whenever user clicks on this URL i want to redirect user to my custom domain i.e. request should get redirect to ..
http://www.mydomain.com/view/121200/this-is-test/
/view is mapped servlet which gets control when user clicks on above url, so i am not sure if i can achieve redirect by detecting req.getServerName() and then if ServerName is “myapp.appspot.com” redirect to “www.mydomain.com”
Please advise what is best way to achieve this, let me know if you need code snippet.
Can’t you just
If you want to test if you’re running on AppEngine, try using an AppEngine class in a try/catch block.