Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 244275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:59:28+00:00 2026-05-11T20:59:28+00:00

I am trying to redirect a user when they entire a URL in this

  • 0

I am trying to redirect a user when they entire a URL in this format:

http://example.com/http://example2.com/

To the following:

http://example.com/?m=example2.com#http%3A%2F%2Fwww.example2.com%2F

I want to strip out the host of example2 and make it a query-string, then URL encode the full URL of example2 and put it as the anchor.

What is the best way to do this in asp.net? I can use mvc, iis7, or iis6. I know I could do this by mapping everything to .NET in IIS6 and then using httpcontext.rewritepath but I bet there is a better way.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:59:28+00:00Added an answer on May 11, 2026 at 8:59 pm

    Unfortunately, ASP.NET does not allow a colon anywhere in the URL path. Not even an escaped colon (%3A). It is only allowed in the querystring portion of the path.

    This restriction is in place even before URL rewriting happens. (You’ll get the 400 Bad Request error.) In that question, the asker answered their own question with a link to Stefan from the ASP.NET team.

    Of course, you can still collect the URL from your user any way you like, and format the URL or redirect in a way that ASP.NET can use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to redirect ALL requests for mydomain.com whether they are something like:
I'm trying to redirect the user if they login successfully but the code I
I am trying to redirect the user to a registered page once they have
I'm trying to redirect the user if their account hasn't been confirmed. So this
I am trying to a redirect the user when they click on a specific
I am trying to find a way to redirect a user when they come
This is probably one of those easy questions.. I'm trying to redirect the user
Im trying to redirect a user once they logon to the secure part of
I am trying to redirect a page reading the url from the config file.
I am trying to redirect user to show_city_url or show_city_path but i get an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.