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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:46:21+00:00 2026-05-23T01:46:21+00:00

Question: I am creating a wiki software, basically a clone of wikipedia/mediawiki, but in

  • 0

Question:

I am creating a wiki software, basically a clone of wikipedia/mediawiki, but in ASP.NET MVC (the MVC is the point, so don’t recommend me ScrewTurn).

Now I have a question:

I use this route mapping, to route a URL like:
http://en.wikipedia.org/wiki/ASP.NET

        routes.MapRoute(
            "Wiki", // Routenname
            //"{controller}/{action}/{id}", // URL mit Parametern
            "wiki/{id}", // URL mit Parametern
            new { controller = "Wiki", action = "dbLookup", id = UrlParameter.Optional } // Parameterstandardwerte
        );

Now it just occured to me, that there might be titles like ‘AS/400’:
http://en.wikipedia.org/wiki/AS/400

Incidentially, there is also this one (title ‘Slash’):
http://en.wikipedia.org/wiki//

And this one:
http://en.wikipedia.org/wiki//dev/null

Overall, Wikipedia seems to have a list of interesting titles like this:
http://en.wikipedia.org/wiki/Wikipedia:Articles_with_slashes_in_title

How do I make routes like this route correctly ?

Edit:
Something like:
If the URL starts with /Wiki/, and if it doesn’t start with /wiki/Edit/
(but not /Wiki/Edit)
then pass all the rest of the URL as Id.

Edit:
Hmm, just another problem:
How can I route this one:
http://en.wikipedia.org/wiki/C&A

Wikipedia can…

Edit:
According to wikipedia, due to clashes with wikitext syntax, only the following characters can never be used in page titles (nor are they supported by DISPLAYTITLE):

# < > [ ] | { }

http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters

Edit:
To allow * and &, put

<httpRuntime requestPathInvalidCharacters="" />

into section <system.web> in file web.config

(Found here: http://www.christophercrooker.com/use-any-characters-you-want-in-your-urls-with-aspnet-4-and-iis)

  • 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-23T01:46:22+00:00Added an answer on May 23, 2026 at 1:46 am

    You could use a catchall route to capture everything that follows the wiki part of the url into the id token:

    routes.MapRoute(
        "Wiki",
        "wiki/{*id}",
         new { controller = "Wiki", action = "DbLookup", id = UrlParameter.Optional }
    );
    

    Now if you have the following request: /wiki/AS/400 it will map to the following action on the Wiki controller:

    public ActionResult DbLookup(string id)
    {
        // id will equal AS/400 here
        ...
    }
    

    As far as /wiki// is concerned I believe you will get a 400 Bad Request error from the web server before this request ever reaches the ASP.NET pipeline. You may checkout the following blog post.

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

Sidebar

Related Questions

Sorry if this is a dumb question but im creating a filter class that
I found this question which is a great starting point towards creating embedded widgets
I have a simple question about creating multiple initialisers within an objective-c class. Basically
I am in the process of creating a RESTful API. I read http://microformats.org/wiki/rest/urls but
As in the question Creating simple c++.net wrapper. Step-by-step I am tring to use
Following on from my earlier question about creating Address Books (many thanks Peter!), I
I have seen a couple of question regarding creating datasets in DbUnit here on
I posted a question here concerning creating a shopping cart. It seems maybe I
nobody loved my first question about this: Creating Entity Framework objects with Unity for
(creating a separate question after comments on this: Javascript redeclared global variable overrides old

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.