0

Say I have this url "/my#stuff"

I am using asp.net mvc and when I try to goto this page it takes me to just "/my". The "#stuff" part has been removed.

Now I can get it to work fine if I encode the URL like so "/my%23stuff" since %23 decodes to #

However, is there a way I can get this to work without having to encode the url?

I'd like it if typing in "/my#stuff" as the URL worked just the same as "my%23stuff"

1 Answer 1

3

I don't think there is a way to do what you are saying. The hash is used in a URL for anchor tags.

You are pointing at a page /my and navigating to anchor tag "stuff" on that page. If anchor tag "stuff" does not exist it will just navigate to page /my.

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, that's the rule for HTTP URLs - but I can imagine you're skipping that level of detail considering the example in the question is missing at least the protocol and hostname.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.