How to Fix External Links Not Working in HTML Uploaded to SharePoint
Question details
The user needs to resolve an issue where external hyperlinks within a custom HTML file fail to open after the file is uploaded to a SharePoint document library.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Uploading and viewing a custom HTML file containing external web links in a SharePoint document library.
- Observed behavior
- Images and icons in the HTML file display correctly, but clicking the external hyperlinks does nothing or results in a failure to navigate.
Verify that your HTML file functions correctly by opening it locally in your default web browser before uploading it to the SharePoint environment.
Validate and Format Links as Absolute HTTPS URLs
Ensure all hyperlinks are properly formatted as absolute URLs to prevent SharePoint from misinterpreting them as broken internal paths.
SharePoint security protocols and HTML sanitization often block improperly formatted or relative URLs in uploaded web files. Using complete, absolute HTTPS URLs is the most reliable way to ensure links open correctly.
Open your HTML file locally using a plain text editor like Notepad or VS Code and locate all your anchor tags (<a>).
Verify that the 'href' attribute contains a full HTTPS URL. For example, change href="www.example.com" to href="https://www.example.com".
Save your code changes, open the HTML file directly in a web browser outside of SharePoint, and click the links to confirm they navigate properly.
Navigate to your SharePoint document library, upload the modified HTML file, and click on it to test the external links within the SharePoint environment.

Consult Microsoft Q&A for Development Support
If standard URL validation fails, SharePoint's strict HTML sanitization rules may be blocking the links, requiring specialized developer troubleshooting.
Switch to WPS Office for Seamless Document Management
SharePoint's strict security restrictions on custom HTML and embedded files can be frustrating. If you are looking for a highly compatible, lightweight, and completely free alternative for managing documents without strict local network limitations, WPS Office is an excellent choice.
- 1. Download the Installer: Visit the official WPS website and download the free WPS Office suite for your operating system.
- 2. Install and Launch: Run the installer, complete the quick setup process, and open the WPS Office workspace.
- 3. Manage Documents Securely: Open your Word, Excel, or PDF files to seamlessly read, edit, and navigate embedded hyperlinks without backend server restrictions.

Frequently Asked Questions
Why does SharePoint block some external links in my HTML file?
SharePoint implements strict security mechanisms, such as HTML sanitization and NoScript settings, to prevent malicious code execution (XSS). This often strips out unverified links, JavaScript-based navigation, or improperly formatted external hyperlinks.
Do relative links work in SharePoint document libraries?
Relative links typically only function correctly when pointing to other files or resources stored within the exact same SharePoint environment. To link to external websites, you must use absolute URLs that begin with HTTPS.
Can I bypass SharePoint's HTML restrictions by renaming the file extension?
No. SharePoint determines how to render and secure files based on server-side configurations. Renaming an HTML file to an ASPX file is generally blocked by default tenant security settings unless custom scripting is explicitly enabled by your SharePoint administrator.




