Skip to content

Commit 2bbabad

Browse files
committed
Added an example for serving files from .well-known path
1 parent 87d2292 commit 2bbabad

File tree

8 files changed

+140
-0
lines changed

8 files changed

+140
-0
lines changed

13/umbraco-cms/reference/routing/iisrewriterules.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,38 @@ An example configuration to help ensure your custom rules integrate properly:
186186
{% hint style="info" %}
187187
If you use **Umbraco Cloud**, check the [Rewrite Rules](https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/manage-hostnames/rewrites-on-cloud) article.
188188
{% endhint %}
189+
190+
### Example: Serving Files from the `.well-known` Path
191+
192+
Some third-party services such as Apple Pay, Google, or other integrations, require you to host a verification file at a specific URL like:
193+
194+
```text
195+
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
196+
```
197+
198+
On Umbraco Cloud, directly hosting files in the `.well-known` folder (for example, via Git or Kudu) may result in a 404 error due to platform restrictions.
199+
200+
To work around this, you can serve the required file using Umbraco's **Media** library in combination with an IIS rewrite rule..
201+
202+
To do so, follow these steps:
203+
204+
1. Go to the **Media** section in the Umbraco backoffice.
205+
2. Create a folder named `.well-known`.
206+
This folder is only for your own organization. It does not affect the public file URL.
207+
3. Upload the verification file. For example: *test.txt*.
208+
209+
![Uploading Verification file in the Backoffice](images/upload-verification-file.png)
210+
211+
4. Copy the Media file URL. For example, `/media/4jhhlmxk/verification.txt`.
212+
5. Add a rewrite rule in your `web.config` file:
213+
214+
```xml
215+
<rule xdt:Transform="Insert" name="Rewrite Apple Developer Merchant ID" stopProcessing="true">
216+
<match url="^\.well-known/apple-developer-merchantid-domain-association$" />
217+
<action type="Rewrite" url="/media/4jhhlmxk/test.txt" />
218+
</rule>
219+
```
220+
221+
{% hint style="info" %}
222+
Replace the `match` and `url` values with your specific Media path and verification filename.
223+
{% endhint %}
64.4 KB
Loading

14/umbraco-cms/reference/routing/iisrewriterules.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,38 @@ An example configuration to help ensure your custom rules integrate properly:
186186
{% hint style="info" %}
187187
If you use **Umbraco Cloud**, check the [Rewrite Rules](https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/manage-hostnames/rewrites-on-cloud) article.
188188
{% endhint %}
189+
190+
### Example: Serving Files from the `.well-known` Path
191+
192+
Some third-party services such as Apple Pay, Google, or other integrations, require you to host a verification file at a specific URL like:
193+
194+
```text
195+
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
196+
```
197+
198+
On Umbraco Cloud, directly hosting files in the `.well-known` folder (for example, via Git or Kudu) may result in a 404 error due to platform restrictions.
199+
200+
To work around this, you can serve the required file using Umbraco's **Media** library in combination with an IIS rewrite rule..
201+
202+
To do so, follow these steps:
203+
204+
1. Go to the **Media** section in the Umbraco backoffice.
205+
2. Create a folder named `.well-known`.
206+
This folder is only for your own organization. It does not affect the public file URL.
207+
3. Upload the verification file. For example: *test.txt*.
208+
209+
![Uploading Verification file in the Backoffice](images/upload-verification-file.png)
210+
211+
4. Copy the Media file URL. For example, `/media/4jhhlmxk/verification.txt`.
212+
5. Add a rewrite rule in your `web.config` file:
213+
214+
```xml
215+
<rule xdt:Transform="Insert" name="Rewrite Apple Developer Merchant ID" stopProcessing="true">
216+
<match url="^\.well-known/apple-developer-merchantid-domain-association$" />
217+
<action type="Rewrite" url="/media/4jhhlmxk/test.txt" />
218+
</rule>
219+
```
220+
221+
{% hint style="info" %}
222+
Replace the `match` and `url` values with your specific Media path and verification filename.
223+
{% endhint %}
64.4 KB
Loading

15/umbraco-cms/reference/routing/iisrewriterules.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,38 @@ An example configuration to help ensure your custom rules integrate properly:
186186
{% hint style="info" %}
187187
If you use **Umbraco Cloud**, check the [Rewrite Rules](https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/manage-hostnames/rewrites-on-cloud) article.
188188
{% endhint %}
189+
190+
### Example: Serving Files from the `.well-known` Path
191+
192+
Some third-party services such as Apple Pay, Google, or other integrations, require you to host a verification file at a specific URL like:
193+
194+
```text
195+
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
196+
```
197+
198+
On Umbraco Cloud, directly hosting files in the `.well-known` folder (for example, via Git or Kudu) may result in a 404 error due to platform restrictions.
199+
200+
To work around this, you can serve the required file using Umbraco's **Media** library in combination with an IIS rewrite rule..
201+
202+
To do so, follow these steps:
203+
204+
1. Go to the **Media** section in the Umbraco backoffice.
205+
2. Create a folder named `.well-known`.
206+
This folder is only for your own organization. It does not affect the public file URL.
207+
3. Upload the verification file. For example: *test.txt*.
208+
209+
![Uploading Verification file in the Backoffice](images/upload-verification-file.png)
210+
211+
4. Copy the Media file URL. For example, `/media/4jhhlmxk/verification.txt`.
212+
5. Add a rewrite rule in your `web.config` file:
213+
214+
```xml
215+
<rule xdt:Transform="Insert" name="Rewrite Apple Developer Merchant ID" stopProcessing="true">
216+
<match url="^\.well-known/apple-developer-merchantid-domain-association$" />
217+
<action type="Rewrite" url="/media/4jhhlmxk/test.txt" />
218+
</rule>
219+
```
220+
221+
{% hint style="info" %}
222+
Replace the `match` and `url` values with your specific Media path and verification filename.
223+
{% endhint %}
64.4 KB
Loading

16/umbraco-cms/reference/routing/iisrewriterules.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,38 @@ An example configuration to help ensure your custom rules integrate properly:
186186
{% hint style="info" %}
187187
If you use **Umbraco Cloud**, check the [Rewrite Rules](https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/manage-hostnames/rewrites-on-cloud) article.
188188
{% endhint %}
189+
190+
### Example: Serving Files from the `.well-known` Path
191+
192+
Some third-party services such as Apple Pay, Google, or other integrations, require you to host a verification file at a specific URL like:
193+
194+
```text
195+
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
196+
```
197+
198+
On Umbraco Cloud, directly hosting files in the `.well-known` folder (for example, via Git or Kudu) may result in a 404 error due to platform restrictions.
199+
200+
To work around this, you can serve the required file using Umbraco's **Media** library in combination with an IIS rewrite rule..
201+
202+
To do so, follow these steps:
203+
204+
1. Go to the **Media** section in the Umbraco backoffice.
205+
2. Create a folder named `.well-known`.
206+
This folder is only for your own organization. It does not affect the public file URL.
207+
3. Upload the verification file. For example: *test.txt*.
208+
209+
![Uploading Verification file in the Backoffice](images/upload-verification-file.png)
210+
211+
4. Copy the Media file URL. For example, `/media/4jhhlmxk/verification.txt`.
212+
5. Add a rewrite rule in your `web.config` file:
213+
214+
```xml
215+
<rule xdt:Transform="Insert" name="Rewrite Apple Developer Merchant ID" stopProcessing="true">
216+
<match url="^\.well-known/apple-developer-merchantid-domain-association$" />
217+
<action type="Rewrite" url="/media/4jhhlmxk/test.txt" />
218+
</rule>
219+
```
220+
221+
{% hint style="info" %}
222+
Replace the `match` and `url` values with your specific Media path and verification filename.
223+
{% endhint %}
64.4 KB
Loading

0 commit comments

Comments
 (0)