microsoft / AzUrlShortener

An simple and easy Url Shortener
MIT License
519 stars 560 forks source link

Unable to resolve short URL's #443

Closed fatpacket closed 1 year ago

fatpacket commented 1 year ago

I have followed all the directions and reviewed all the documentation in this issue #433 . I have been able to test the default azure app service URL with the /api/urlredirect/test and that works. I created a vanity with the Storage Explorer and the default azure url and /api/urlredirect/{vanity} works. I added the custom domain also with certificate from video and your note here and when I test https://custom.dom/api/urlredirect/test - that works https://custom.dom/api/urlredirect/{my vanity} - that works https://custom.dom/{vanity} - Nothing Works!!

Not sure what the appropriate behavior is but I suspect /{vanity} is suppose to work or things would not really be a shortner.

Any assistance would be appreciated.

┆Issue is synchronized with this Trello card by Unito

fatpacket commented 1 year ago

I should add the "Clicks" field increments when I hit the https://custom.dom/api/urlredirect/{vanity} but not when I hit https://custom.dom{vanity}

fatpacket commented 1 year ago

Didnt there used to be some instructions on adding a custom domain to the function configuration itself as a config value or am I mis-remembering that? I know you updated some docs but in that previous note you mention configuring the custom domain and some rules. I added the custom domain per the video and like I said above the test and vanity work just not as part of the short URL. I keep going over this thinking I have missed something but not finding any mistakes on my part

FBoucher commented 1 year ago

@fatpacket make sure you follow the instruction to add a custom domain.

And be careful in the section about the RULES

See how the rule is different in version 3. The Azure Function isolated process doesn't have proxies anymore. In the previous versions, the Azure Function proxy was redirecting all traffic by default to our api/urlRedirect. However, now that is not supported the complete URL needs to be specified in the rule. (ex: https://www.c5m.ca/api/urlredirect/$1)

image

fatpacket commented 1 year ago

Make sense. I was trying to do it all within the function code and just use CF rules for the naked URL re-write. But I guess in V3 things have changed a bit more. As I mentioned in another comment, I was looking for a more complete API to generate short URLs as well as be able to redirect and track hits. Hopefully that will appear in a future version. Have enjoyed working through my issues and really appreciate all the help

-Fatpacket