Redirect "website.pythonanywhere.com" to "www.newwebsite.de"

35 views
Skip to first unread message

Alexander Hoch

unread,
Feb 16, 2020, 8:24:56 PM2/16/20
to web2py-users
Hello,


I tried it with https://www.nakedssl.com/ but this doesnt work as described in https://help.pythonanywhere.com/pages/NakedDomains for me.

There is another suggestion in deploying a flask app and redirect with the this sample code: https://help.pythonanywhere.com/pages/RedirectWebApp/
Is there an equivalent solution in web2py? or is there some possiblity to change routes.py to redirect a request.env to the new  "www.newwebsite.de/.../123/=abc".  with variables, functions and argument.
This is too difficult for hobby programmer. I really would appreciate your help.

Cheers ;)

villas

unread,
Feb 22, 2020, 7:39:00 AM2/22/20
to web2py-users
Hi Alexander

If you cannot redirect using the webserver,  and you cannot figure out routes, I guess you could still do something simple in your web2py controller, like this...

def index():
    redirect('https://www.my_redirected_site.com{0}'.format(request.env.request_uri))


Reply all
Reply to author
Forward
0 new messages