Set up a custom do-not-rewrite URLs list using Office 365 ATP Safe Links


This article is intended for business customers who have Office 365 Advanced Threat Protection. If you are a home user looking for information about Safe Links in Outlook, see Advanced security.

With Office 365 Advanced Threat Protection (ATP), your organization can have a custom blocked URLs, such that when people click on web addresses (URLs) in email messages or certain Office documents, they are prevented from going to those URLs. Your organization can also have custom "do not rewrite" lists for specific groups in your organization. A "do not rewrite" list enables some people to visit URLs that are otherwise blocked by ATP Safe Links in Office 365.

This article describes how to specify a list of URLs that are excluded from ATP Safe Links scanning, and a few important points to keep in mind.

Set up a "do not rewrite" list

ATP Safe Links protection uses several lists, including your organization's blocked URLs list and the "do not rewrite" lists for exceptions. If you have the necessary permissions, you can set up your custom "do not rewrite" lists. You do this when you add or edit Safe Links policies that apply to specific recipients in your organization.

To edit (or define) ATP policies, you must be assigned an appropriate role. The following table includes some examples. To learn more, see Permissions in the Office 365 Security & Compliance Center.

Role Where/how assigned
Office 365 Global Administrator The person who signs up to buy Office 365 is a global admin by default. (See About Office 365 admin roles to learn more.)
Security Administrator Azure Active Directory admin center (
Exchange Online Organization Management Exchange admin center (
PowerShell cmdlets (See Exchange Online PowerShell)


To learn more about roles and permissions, see Permissions in the Office 365 Security & Compliance Center.

To view or edit a custom "do not rewrite" URLs list

  1. Go to and sign in with your work or school account.

  2. In the left navigation, under Threat management > Policy > Safe Links.

  3. In the Policies that apply to specific recipients section, choose New (the New button resembles a plus sign ( +)) to create a new policy. (Alternatively, you can edit an existing policy.)
    Choose New to add a Safe Links policy for specific email recipients

  4. Specify a name and description for your policy.

  5. In the Do not rewrite the following URLs section, select the Enter a valid URL box, and then type a URL, and then choose the plus sign (+).

  6. In the Applied To section, choose The recipient is a member of, and then choose the group(s) you want to include in your policy. Choose Add, and then choose OK.

  7. When you are finished adding URLs, in the lower right corner of the screen, choose Save.


Make sure to review your organization's custom list of blocked URLs. See Set up a custom blocked URLs list using ATP Safe Links.

Important points to keep in mind

  • Any URLs that you specify in the "do not rewrite" list are excluded from ATP Safe Links scanning for the recipients that you specify.

  • If you already have a list of URLs in your "do not rewrite" list, make sure to review that list and add wildcards as appropriate. For example, if your existing list has an entry like and you want to include subpaths like in your policy, add a wildcard to your entry so it looks like*.

  • Do not include a forward slash (/) in the URLs that you specify in your "do not rewrite" list. For example, rather than enter in your "do not rewrite" list, enter

  • When you specify a "do not rewrite" list for an ATP Safe Links policy, you can include up to three wildcard asterisks (*). Wildcards (*) are used to explicitly include prefixes or subdomains, like http:// or https://. An entry, such as is not the same as ** for your "do not rewrite" list. You must have ** if you want to allow people to visit a domain and its subdomains and paths.

The following table lists examples of what you can enter and what effect those entries have.

Example Entry What It Does Allows recipients to visit a site like but not subdomains or paths.
Allows recipients to visit a domain, subdomains, and paths, such as,,, or
Allows specific recipients to visit a site like, but not subpaths like*
Allows specific recipients to visit a site like and subpaths like