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

  • SEARCH
  • Home
  • 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 8141999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:41:17+00:00 2026-06-06T12:41:17+00:00

A specific page in my web application has a URL www.example.com/Test/Index However, I want

  • 0

A specific page in my web application has a URL www.example.com/Test/Index

However, I want to make this URL accessible when the user simply inputs www.example.com/Test instead of the whole thing.

So how can this be done using C# alone? Any help will be highly appreciated!

  • 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-06-06T12:41:18+00:00Added an answer on June 6, 2026 at 12:41 pm

    You can use a redirect. In ASP.NET this is Response.Redirect. In MVC this is RedirectToAction(“Index”). This will cause their browser to then request the other URL.

    If you want the URL to not be changed/redirected, and show www.example.com/Test, then you can use a server side redirect. ASP.NET: Server.Transfer. In MVC you can just return Index(); but this can be problematic sometimes. A better option is to use a default route:

    public class MvcApplication : System.Web.HttpApplication
      {
    ...
        public static void RegisterRoutes(RouteCollection routes)
        {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Test", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
    
        }
    

    You should get this code automatically with any newly created MVC 3 application. you just have to custimize it for the controller you want to respect this default route.

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

Sidebar

Related Questions

I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The
I have a web application written in Django that has one specific page I'd
I am working on a web application that has a single master page and
I'm working on application which has workflow like this: 1.parsing home page (using HttpURLConnection,
I'm developing an ASP.NET web application. When a user loads a specific page on
I am loading a specific web page in a WebBrowser control. Is there a
Let's assume I browse a specific web page that uses JavaScript to update its
I've been working on a rather large web application that requires a specific id
I'm building a web application for my friend. He wants this application to be
I'm working on a web application which has suddenly become extremely unresponsive in Google

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.