0

We need to do SEO redirect for urls like:

//////controller/action

to

/controller/action

Request.Url and Request.RawUrl doesn't have '////' part, it shows only one slash.

1 Answer 1

4

What you are looking for is Request.ServerVariables["HTTP_URL"].

If you are using IIS7 or above you may want to look at using the IIS Rewrite Module, which will allow you write a regex to catch URLs with multiple forward slashes and redirect them. This will save you having to write code to do it.

http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

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

Comments

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.