question

MikhailSmal-8890 avatar image
0 Votes"
MikhailSmal-8890 asked MikhailSmal-8890 answered

Front Door redirect to path rule

Hi,

I am trying to configure redirect rule in Front Door.
I need to redirect:

subdomain.domain.com/some/path
to
www.domain.com/new-subdomain-home/some/path

Basically I need to preserve the path and prepend it.

According to the documentation: https://docs.microsoft.com/en-us/azure/frontdoor/front-door-url-redirect#destination-path I can only replace the path to some constant value, there is no placeholder for original path mentioned.

Is this even possible? Pretty critical to us. Also maybe there is another Azure service which can do such redirect?

Thanks.

azure-front-door
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @MikhailSmal-8890 ,

Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

You can use Azure Front Door's redirect capabilities to return 301/302/307/308 redirects to the client to redirect to new hostnames/domains, paths, and protocols.

For your example of subdomain.domain.com/some/path to www.domain.com/new-subdomain-home/some/path, you can configure the rule as below:

75903-afd-redirect.jpg

I couldn't understand the part where you mentioned "I can only replace the path to some constant value, there is no placeholder for original path mentioned.". Could you please provide some more details on same?

Thanks,
Gita





0 Votes 0 ·
afd-redirect.jpg (81.9 KiB)
MikhailSmal-8890 avatar image MikhailSmal-8890 GitaraniSharmaMSFT-4262 ·

Hello @GitaraniSharmaMSFT-4262,
thanks for your answer. I understand that I can explicitly set up redirect from /some/path to /new-subdomain-home/some/path. But I want all paths to be dynamically redirected from subdomain.domain.com/ to the same paths, but with /new-subdomain-home/ prefix. Smth like subdomain.domain.com/ -> www.domain.com/new-subdomain-home/

This is not about only one specific path, it is about all possible paths on the old domain.

Regarding the placeholder, I thought that I could set /new-subdomain-home/{originalPath} as the destination path, but I couldn't find it in any documentaion.

0 Votes 0 ·

Hello @MikhailSmal-8890 ,

Thank you for the update. I am not sure if it is possible to set it the way you are asking but let me do some research & get back to you.

Regards,
Gita

0 Votes 0 ·

Hello @MikhailSmal-8890 ,

Apologies for the delay in my response.

Prepending is possible with server variables:
https://docs.microsoft.com/en-us/azure/frontdoor/standard-premium/concept-rule-set-actions?tabs=portal#server-variables

Path variable can be something like this - /new-subdomain-home/{url_path}

Also, ‘rewrite’ instead of ‘redirect’ is possible with URL rewrite --> it always preserves the unmatched path and prepend the custom path.
Please refer : https://docs.microsoft.com/en-us/azure/frontdoor/front-door-url-rewrite

89948-image.png

Kindly let us know if the above helps or you need further assistance on this issue.

Thanks,
Gita

0 Votes 0 ·
image.png (4.4 KiB)

1 Answer

MikhailSmal-8890 avatar image
1 Vote"
MikhailSmal-8890 answered

Hello @GitaraniSharmaMSFT-4262,

Thank you, however your advice doesn't seem to work for me:

102752-image.png



I believe this is a problem of the service called just "Front Door", not Standard/Premium Front Door. But I don't see any option to upgrade. Our instance was setup about 1.5 years ago.


image.png (119.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.