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 7830673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:20:58+00:00 2026-06-02T11:20:58+00:00

We are using Areas to version an API written in ASP.NET MVC3 with AttributeRouting

  • 0

We are using Areas to version an API written in ASP.NET MVC3 with AttributeRouting to define our routes.

Right now we have a “v1” area that is our first version of API. When we got to v2, we will copy over v1 and make modifications.

I want to use the same versioning for a website and I don’t want the /v1 in the route.

My question is, how do I hide the Area in my URL so I can call

mywebsite.com/Users/1 

instead of

mywebsite.com/v1/Users/1

Here is what I have in my controller

    [RouteArea("/")]
    public class HomeController : Controller
    {
        //
        // GET: /v1/Home/
        [GET("")]
        public ActionResult Index()
        {
            return View();
        }

    }

and here is what I get when I try to visit mywebsite.com/

error

Thanks in advance!

  • 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-02T11:21:00+00:00Added an answer on June 2, 2026 at 11:21 am

    Do this:

    [RouteArea("AreaName", AreaUrl = "")]
    

    By default, areas are prefixed with the area name. The AreaUrl property lets you override that. I’ll update the wiki here: https://github.com/mccalltd/AttributeRouting/wiki/Areas

    Sorry for the confusion!

    Also, you shouldn’t add forward-slashes at the beginning or end of any urls defined via AR. Your stack trace dump highlights that MVC is looking for views in a folder named “/”. If you want an empty url, just use “”.

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

Sidebar

Related Questions

I am using Asp.Net MVC 2 - RC w/ Areas. I am receiving an
I'm using the version 3 API and I have a text input that the
Right now, my application is using the c-ares asynchronous DNS resolver library on Windows
I have successfully implemented this method of using the Win32 API to set the
I'm using jquery tabs ( http://docs.jquery.com/UI/API/1.7.2/Tabs ). Jquery version 1.3.2 and Jquery UI version
Looking for some feedback on setting up our solutions in TFS. Right now we
When using the Salesforce Partner API (version 21.0), how can I determine if the
I am using mvc3 and I want to create an API with the site.
I'm using TinyMCE on the text-areas in my Magento admin section. I have my
When not using areas dealing with the url for the JsonResults from the clientside

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.