Fix PDF Hyperlinks with Hash Symbols Returning 404 Errors
Question details
Hyperlinks containing a hash (#) fragment work correctly when a PDF is viewed locally, but return a 404 error after the PDF is uploaded to a website.

- Product
- Device & OS
- not provided
- Scenario
- Clicking a hyperlink with a hash fragment (anchor link) inside a hosted online PDF document.
- Observed behavior
- The browser returns a 404 Not Found error because the hash symbol is misinterpreted, stripped, or incorrectly URL-encoded when interacting with the web server.
Verify the exact web address in a standard browser to ensure the target web page and its anchor link are currently live and functioning properly before editing your PDF.
Check and Correct URL Encoding in the PDF Editor
Manually inspect the hyperlink properties in your PDF to ensure the hash symbol has not been automatically encoded to '%23'.
A hash symbol (#) identifies a specific location or anchor within a web page and is typically handled by the browser, not the server. If your PDF editor or converter mistakenly URL-encodes the hash symbol into '%23', the web server will interpret it as part of the file name or path, resulting in a 404 error.
Open your PDF document in a dedicated PDF editor. Select the 'Edit Link' or 'Link' tool from the toolbar.
Double-click the broken hyperlink to open the Link Properties or URL Action dialog box.
Look closely at the destination URL. If the address contains '%23' instead of a literal '#', manually type the '#' symbol to replace the encoded characters.
Click OK to apply the changes, save the PDF, and re-upload it to your website to test the hyperlink.

Recreate Hyperlinks in the Source Document
Update and verify the URL structure in your original word processor document before converting it to PDF to minimize link corruption.
Troubleshoot Server-Side Link Handling
Determine if your website's server, security system, or Content Management System (CMS) is mishandling hash fragments on incoming requests.
Fix and Manage PDF Hyperlinks with WPS Office
WPS Office provides a comprehensive PDF editing suite that allows you to easily insert, modify, and test hyperlinks directly within your PDF files. It preserves exact URL strings to ensure your links work perfectly both offline and online.
- 1. Open your PDF: Launch WPS Office and open the PDF document containing the broken links.
- 2. Access link tools: Navigate to the 'Edit' tab on the top ribbon and click on the 'Link' button.
- 3. Edit link properties: Double-click the hyperlink area to open the Link Properties dialog. Select 'Open a web link'.
- 4. Update the URL: Type or paste your exact URL including the '#' symbol into the destination field, then click OK and save your document.

Frequently Asked Questions
Why does a hash symbol in a URL cause a 404 error?
A hash symbol (#) is meant to be handled by the user's web browser to jump to a specific section of a page. If a PDF editor or server improperly encodes the '#' into '%23', the web server thinks '%23' is part of the file name. Since no file with that name exists, it returns a 404 Not Found error.
Can I link to a specific page within an online PDF?
Yes, you can link to a specific page of an online PDF by appending '#page=pagenum' to the end of the URL (e.g., example.com/file.pdf#page=4). However, the web server hosting the PDF must support byte-serving (Accept-Ranges) for this to work correctly.
How do I stop my PDF converter from changing # to %23?
This happens when the conversion tool automatically URL-encodes special characters. To prevent this, try recreating the hyperlink in the source document without extra spaces, or use a dedicated PDF editor like WPS Office to manually correct the link destination after conversion.




