How to Investigate SharePoint CDN URL Rewriting to afdcache.ashx
Question details
The user needs to investigate unexpected SharePoint Search URL rewriting to afdcache.ashx and unusual image paths when utilizing a Private CDN.
- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Using a Private CDN in SharePoint and noticing unexpected image URL paths generated in search results.
- Observed behavior
- SharePoint Search URLs are unexpectedly rewritten to afdcache.ashx without clear public documentation explaining the behavior.
Gather your Microsoft 365 tenant details, Private CDN configuration settings, field definitions, and specific examples of the rewritten URLs before proceeding.
Contact Microsoft 365 Technical Support
Because the URL rewriting behavior to afdcache.ashx is not sufficiently documented for a reliable public explanation, escalating the issue to Microsoft Support is the recommended action.
SharePoint's Private CDN features complex backend routing to optimize content delivery. When search URLs are unexpectedly rewritten to afdcache.ashx, it typically requires backend service review by Microsoft engineers.
Document your Microsoft 365 tenant ID, your current Private CDN configuration settings, and the specific field definitions where the issue occurs.
Copy the exact rewritten URLs (containing afdcache.ashx) and the original unexpected image paths you are experiencing.
Navigate to the Microsoft 365 admin center, go to the Support section, and create a new service request including all the gathered details.
Try WPS Office for Seamless Document Management
While troubleshooting complex SharePoint infrastructure issues, ensure your daily document workflow remains uninterrupted. WPS Office is a lightweight, highly compatible alternative to Microsoft Office that easily handles Word, Excel, and PowerPoint files without the heavy overhead.
- 1. Download the installer: Visit the official WPS website and download the free installation package.
- 2. Install the software: Run the installer and follow the on-screen prompts to complete the setup in minutes.
- 3. Open your documents: Launch WPS Office and instantly open your existing Microsoft Office files with perfect formatting.

Frequently Asked Questions
What is afdcache.ashx in SharePoint?
It is a system handler used by SharePoint's content delivery network (CDN) infrastructure to serve cached files and images, optimizing load times for users. However, its exact URL rewriting behavior is largely undocumented.
Why are my SharePoint image paths changing automatically?
When a Private CDN is enabled, SharePoint may rewrite URLs to route image and asset requests through the CDN servers for faster, optimized delivery.
Can I disable the Private CDN in SharePoint to stop the URL rewriting?
Yes, tenant administrators can manage CDN settings using the SharePoint Online Management Shell with the Set-SPOTenantCdnEnabled cmdlet, though it is recommended to consult Microsoft support before making infrastructure changes.




