问题
This is a follow up to my question from yesterday Azure Storage blob using custom domain is not resolving while subdomain worked - how to set up host records?
The objective is to have blob storage files be reachable and ranked on google via our custom domain for example: http://contoso.com/docs/product1-specs.pdf.
This is a new website and so there's no concern with needed redirects from old links.
so in an html file on "contoso.com/product1" you'd have an internal link for example
<a href="/docs/product1-specs.pdf">product 1 specs</a>
where "contoso.com" is our custom domain hosted by Azure App Service where "contoso1.blob.core.windows.net" is the Azure Storage Account "contoso1" where "/docs/product1-specs.pdf" represents the blob file "product1-specs.pdf" in the container "docs" stored in Azure Storage.
This is a four part question:
Question part 1: what is the SEO friendly and proper technical approach to achieve this internal link and retrieve the blob from Azure storage ? Of course the external link contoso.com/docs/product1-specs.pdf fetched as an external resource also needs to be a valid retrievable url.
Is it: a)setting the custom domain for the storage account to a subdomain assets.contoso.com and then doing an url rewrite/redirect to contoso.com/docs/* b) setting the custom domain for the storage account to contoso.com and then doing an url rewrite/redirect to contoso.com/docs/* c) something different
I prefer not to have to host and manage ranking for a separate site with assets.contoso.com - I'd like to have the blobs organized in the "docs" container that online shows up as if it were a folder called "docs".
Question part 2: I create a test Azure storage account called "iprobesolutions" and set the custom domain to iprobesolutions.com per this screenshot:
https://www.dropbox.com/s/45u6iczcnusuxvl/Screenshot%202016-05-31%2010.31.40.png?dl=0
Is it right to do the following steps in this order: 1) in the Azure storage account set up iprobesolutions.com as the custom domain iprobesolutions.com 2) set dns records for iprobesolutions.com as follows per screenshot: https://www.dropbox.com/s/xqw2d9k3gj6mnjs/Screenshot%202016-05-30%2021.30.22.png?dl=0 and DNS configuration to point iprobesolutions.com to iprobesolutions.blob.core.windows.net 3) finally set up URL rewrite configuration
Or do I ONLY need URL rewrite configuration without having to set up a custom domain in Azure Storage ?
Question part 3:
For the URL configuration part, whether done as step 3 or as a single step, looking at this question How to map Azure Blob with container with a custom domain sub-directory? and another source which of below two would be the correct web.config redirect for IIS 8.5 and what is the difference between the two ? As mentioned, there is no concern for maintaining old links as it's a new website .I'm not clear whether for our specific use case we need a redirect or just a rewrite ?
The goal is to have iprobesolutions.com/docs/product1-specs.pdf be the canonical name (and NOT the Azure blob name),
<rule name="redirect-docs" stopProcessing="true">
<match url="docs/(.*)"/>
<action type="Redirect" url="https://iprobesolutions1.blob.core.windows.net/docs/{R:1}"></action>
</rule>
<rule name="docs redirection" stopProcessing="false">
<match url="docs/(.*)" ignoreCase="true" />
<action type="Redirect" url="https://iprobesolutions.com/docs/{R:1}" redirectType="Permanent" appendQueryString="true" logRewrittenUrl="true" />
</rule>
Question part 4: since iprobesolutions1.blob.core.windows.net is forced as a HTTPS connection, is converting it into an HTTP connection via our HTTP website w going to lead to some browsers giving a false positive of a security alarm and if so, what is the solution to avoiding these false positives without suddenly being constrained to purchase a TSL certificate to force an HTTPS connections to iprobesolutions.com since it's set up as a static marketing website.
Thanks for taking the time to read and I hope someone could chime in from their experience facing similar scenarios to mine!
回答1:
For starters, you can't map your root domain to both an app service and a storage account. I've responded in your other thread.
Also, please note that google is requiring all sites use HTTPS or your site will be penalized. Just something else to consider.
来源:https://stackoverflow.com/questions/37549395/how-to-have-azure-blob-storage-files-be-reachable-via-custom-domain-redirect-or