Support » Fixing WordPress » Encoded URL ( for # in URL) generating 404 error

  • I need site visitors to be able to visit the above URL with the url-encoded version of the hash sign # (the url-encoding for # is %23). When visiting the URL without encoding, i.e., with the # symbol, WordPress takes you to the right section on the page. When attempting to access this URL with the url-encoded version of the URL, i.e., with %23 instead of #, WordPress generates a 404 error. How can I configure WordPress to properly interpret encoded url’s?

    I’m posting a PDF file with the above encoded link on my website. When people click on the link in the PDF file, I want them to get to the right place instead of seeing a 404 error. The source file is in Microsoft Word. The only way I know to save Word as PDF with links embedded is doing Word->Save-As->PDF and choosing the accessible option. This uses Microsoft online services for PDF rendering and automatically uses url-encoding. There is no way I know of to prevent url encoding.

    In any case, encoded url’s should work. Please help figure out how to make WordPress interpret the above encoded URL properly. Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi,
    the # symbol does not need to be encoded as it is being used for its “natural” purpose. It would only need to be encoded if it was used to represent the symbol and not the “function”.

    TLDR: Check if the URL was automatically (and mistakenly) encoded by Word in the “Insert Link” dialog.

    Using the latest version of Word I created a test file in Word with the specified link (with #) as simple text and selected Save As->PDF. Acrobat reader let me follow the link normally although it was not highlighted.
    I then tried inserting a link (Insert/Link) and Word automatically encoded the URL. However I then tried to replace the encoded URL with the non-encoded one and the saved PDF had a highlighted link with the correct (unencoded) URL.

Viewing 1 replies (of 1 total)
  • The topic ‘Encoded URL ( for # in URL) generating 404 error’ is closed to new replies.