Search code examples
html

html URL: '%23' not converted to #


A webpage is opened if the URL contains '#'. But i get 'Page Not Found' error if the url contains '%23' instead of #.

Few months earlier, i was able to access my html page using the following link '%23'. https://www.something.com/index.html%23MyPage

however, these links are now not working. but works if %23 is changed to #. https://www.something.com/index.html#MyPage

curious, what could be the reason. Could it be something changed in the webserver? I have such links specified in many places and do not want to change if possible.

Will appreciate your help.


Solution

  • Using %23 instead of # is not possible. The whole purpose of URL encoded strings is that they should not have any function in the URL itself, so that you can pass letters to the URL which normally have functions.

    For example ? / #. If these characters aren't encoded, the URL wants to treat them according to their function. So what if you want to use one of these characters without their function? You use encoded characters which will have no functions and are simply treated as strings.