Azure wildcard domains and custom "Web Site not found" page - http-status-code-404

We have a app set up with a wildcard domain *.mysite.com
We also have url rewrite rules to redirect www.*.mysite.com to *.mysite.com
As far as I can tell there is no way to map 2nd level subdomains to an azure app. You get a nasty blue "Web Site not found" page.
Is there any way to better handle 2nd level domains? Any way of mapping them to a default site?
Is there a way to customise the 404 "Web Site not found" page?
Thanks.
UPDATE:
So it seems that azure doe not support 2nd level subdomains - bummer.
Is there a way to route 2nd level domains differently to 1st level subdomains? A work around would be to have *.example.com to got to IP one and *.*.example.com go to IP two. Is there a way to do this? We are using route 53 for DNS.

Is there any way to better handle 2nd level domains? Any way of mapping them to a default site?
AFAIK, Azure does not support wildcard custom domains currently. Single wildcard domain (eg *.mysite.com) is well supported, however eg www.*.mysite.com is not supported currently. If you want this feature added, you can locate to here to vote on the issue.
Is there a way to customise the 404 "Web Site not found" page?
For how to customize the 404 error page, you can take a look at the following reference.
Add or modify the web.config file and set the Custom Error Element to On.
<customErrors mode="On">
<error statusCode="404" redirect="~/Error/NotFound"/>
</customErrors>
For more details, you could refer to this article.

Related

How to solve: This URL is already in use by another Google service (Sites Google)?

I have just verified the custom URL for my Sites Google. When I want to assign it, it says, "This URL is already in use by another Google service." Meanwhile, I don't remember using the URL for any Google service. I just verified it with Google Webmasters. Anyway, I use Plesk for my domain services. Any help?
This is my site: https://sites.google.com/view/alvisyhrn/home
This is my URL: www.alvisyahrin.com
Your help will be much appreciated.
Thank you.
I use Google Domains but was running into the same error message. This post suggests creating and then deleting a synthetic redirect record (e.g. www.alvisyahrin.com -> http://google.com) in Google Domains. This displayed a "All resource records in this synthetic record will be deleted." message before deleting, and seems to have done the trick, since as soon as I deleted the synthetic record Sites was willing to use it as a custom domain.
I realize you're using a different registrar for your domain, but visiting your site now it looks like you managed to get things working (I assume by doing something like this). Hopefully this will be a helpful breadcrumb for Google Domains users that run into this, at least.

Azure AD App Requires Full Path for Reply Url?

I'm seeing something weird that I've not run across before. I've got a web app and I redirect in that web app to Azure AD to get a code that I can exchange for an access token. I've done this many times before so I'm just reusing the same code. I've created my app registration in Azure, just as I've done many times before. The problem is this - normally I can just put a host name for a Reply Url in the app configuration and then Azure AD is fine redirecting anywhere to that host.
For example, if I want to redirect to https://foo/users/processcode, I can normally just put a ReplyUrl of https://foo and it all works fine. In this one case, it says "'https://foo/users/processcode' does not match the reply addresses configured for the application blah". If I put in the fully qualified path for the ReplyUrl then it works, but for a variety of reasons that are beyond the scope here I don't want to do that.
So I'm not following why it might have a problem in this case. Wondering if anyone has seen or knows why this might be an issue all of the sudden.
Thanks.
The Redirect URL/ Reply URL has to match the exact page you want to be redirected to. You can add multiple redirect URLs to your application registration information if you want to redirect to different pages in your web site - or your web page could make the redirection for you.
Another option is to add a * in a redirect url as well (https://mywebsite.com/*) - but this only works with non-converged applications.

Google app engine own domain

Im having trouble with Google App Engine and using my own domain. I have a domain that i'm also using in Google Apps for Work.
I have connected my GAE project in Google Apps so they are linked.
I have added my custom domain in GAE, verified ownership and it seems to be correct.
Here is a picture of the GAE settings.
And on Google Apps for work.
The other setting I know I have to do is on my domain registrar. I have added the records from GAE, from the picture I uploaded.
Im using one.com as a domain registrar and my DNS settings look like this:
Am I doing something wrong that you can see directly like "Hey what's this guy doing lol" or does it seem correct at first sight?
Thankful for any help in the right direction.
#
EDIT:
After following the tip from comment, I have verified and mapped the domain "lkpgpremiumcars.com". And added "beta" as subdomain. My "Custom domains" looks the same (like below):
I also removed A and AAAA-records and added a CNAME.
Waiting for DNS update to see if it works.
EDIT 2:
Still dont work.
BTW is it normal behavior that if I select the same subdomain again it says this:
Or is is just because it already points to this app?
You'll need to add this as a sub-domain.
First remove the custom domain (beta.lkpgpremiumcars.com) from the developers console.
Remove the A and AAAA records that you've added to the DNS.
Follow the instructions here and on step 1, only add the domain 'lkpgpremiumcars.com' and verify. This doesn't mean you're pointing the naked domain to your application.
Once it's verified, refresh the page and now you should have the domain available on step 2.
Select the second option on step 2, put 'beta' on the text box and select the previously added domain from the drop down beside. Click Add.
Go back to your DNS settings and add a CNAME record for 'beta' pointing to 'ghs.googlehosted.com.
Allow some time for propagation and it should work!

Google cloud DNS: point naked domain to www?

I maintain the owon.ro domain which uses a simple App engine app.
I also we use google cloud dns.
These are the dns records:
A record with IP addresses:
owon.ro. ->
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21
CNAME
www.owon.ro. -> ghs.googlehosted.com.
And also some MX records.
The problem is that the app is reachable from the www subdomain and the help section states that those IP addresses should be in the A record for the naked domain to redirect to www, but it doesn't work.
I also tried to use # wildcard for the A record but that doesn't work also.
If you go to owon.ro you will see a 404 page but the www subdomain works.
Am I missing something?
Thank you
Found the answer in the end thanks to Dan Cornilescu.
If you use Google Apps you can set up to redirect the naked domain to www.
If not, you will need to follow the steps by going to
Console > App engine > Settings > Custom Domain.
In here, at the second step, you will have to point www to the app (by using the second option) and clicking Add.
And then also point the naked domain to it by choosing the first option and clicking Add again.
So if I understand correctly you will server the app using www subdomain and the naked domain in contrast to redirecting the naked domain to www as in the Google apps case.
In the end, my custom domain tab looked like this.
And my DNS records looked like this
The DNS operations suggested in step 5c (documentation here) are not enough, you also need to actually add the naked domain to the GAE config (in addition to the www one) - step 5d.
5. Continue to the next step the Add new custom domain form, selecting the custom domain you want to point to your App Engine app:
a. Refresh the console domain page so it will list the domains properly.
b. If you want to use a subdomain, such as www, use the second option (http://www.example.com);
c. If you want to use a naked domain, use the first option to specify a naked domain (such as http://example.com).
d. Click Add to create the desired mapping.
To link the naked domain so it points to the www when you are NOT using appengine you simply add both the 'A' record and a '#' record pointing to the Google ips which are and look like this:
A 300
35.232.62.127
# A 300
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21

What is the 'sign-on url' in a Windows Azure Active Directory application?

I have configured my first application in Windows Azure Active Directory and everything works fine: I can login using accounts in my directory.
However, I'm not entirely clear on all the concepts yet, especially the sign-on url. The tooltip says:
The URL where users can sign in and use your app. You can change this later.
But users sign in somewhere on login.windows.net and furthermore, it doesn't matter what I enter here, authentication keeps working. So what is this 'sign-on url'?
If you visit http://aka.ms/myapps, you'll find a long list of applications that have access to your account. If you click on these apps, you should be redirected to a home page where the sign-in process could be initialized. However, if the app doesn't declare a signInUrl in its manifest, you'll get an error that says the app is misconfigured.
something went wrong...
You cannot access this application because it has been misconfigured. Contact your IT department and include the following information:
Undefined Sign-On URL for application "BlahBlahBlah"
In the new Azure portal UI, the "SIGN-ON URL" is now called "Home page URL", which you can find under Branding in the app registration configuration.
I can see why this may be confusing. I think you can look at this as the URL where the whole sign-in process starts (i.e. your app's URL, which, if they're not logged in, will sends them to login.windows.net).
Also, even if for now you might be able to enter anything and authentication still works, I'd try to make it point to the right place just in case things change in the future.
It appears to me that It has significance with respect to wsFederation realm value when user sign out and redirected to Active directory sign in page.
When you add your application to azure ad, it gives you client id and key. When you use that in MVC webappp, you will see that there is an entry like below in web.config:
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" />
<wsFederation passiveRedirectEnabled="true" issuer="https://login.windows.net/{some guid}/wsfed" realm="https://localhost:44304/" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>
Copy the value of user to sign-on url.

Resources