HTTPS URL Redirection

Hello everyone,

I am encountering a difficulty.

I’m trying to set up the following redirection in HTTPS :

from :
https://redirect.econohm.com/?param1=value1
to :
https://www.econohm.com/#?param1=value1

I can’t find a way to do it without using Apache and the .htaccess file.

Thank you in advance for your valuable help.
JBG.

On the client side you can use the js history object’s replaceState to change the URL – that is assuming you don’t need to change the loaded content. You could also reassign the URL with the location object’s assign method on the client side.

Just to help you along as per what @duncan_richards12 advised.

Your https://redirect.econohm.com/?param1=value1 request endpoint could be as follows to open a client form:

@anvil.server.route("/")
def redirect(**params):
   anvil.server.FormResponse('Form', **properties)

Then on the client-side in Form add under __init__

from anvil.js.window import location

location.replace(f"https://www.econohm.com/#?param1={properties['param1']}") 

I finally managed to handle this problem with the help of @anvil.server.route()

Thank you very much for your assistance, which guided me towards the most suitable solution for my needs

Hi @jean-bruno.getenay,

I’m glad you’ve solved your problem! Now that it’s solved, could you perhaps describe what you did and paste a little sample code into the thread? That way, the next person who has this question can find this thread and see the answer!

2 Likes