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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:06:42+00:00 2026-05-26T05:06:42+00:00

Possible Duplicate: How does StackOverflow generate its SEO-friendly URLs? I use Asp.net 4 and

  • 0

Possible Duplicate:
How does StackOverflow generate its SEO-friendly URLs?

I use Asp.net 4 and Routing

I use this Route to create SEO friendly URLs for my website.
Title url paramenter is a string example “This is a Title” as result I get the URL in browser with this format /Content/This%20is%20a%20Title.

I would rather have the white spaces %20 replaced with a more readable dash for example: /Content/This-is-a-Title.

Any idea how to do it? Thanks for your help on this

        routes.MapPageRoute(
            "View Content",                     // Route name
            "Content/{Title}",                  // Route URL
            "~/Cms/FrontEndCms/Content.aspx"    // Web page to handle route
        );
  • 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-26T05:06:43+00:00Added an answer on May 26, 2026 at 5:06 am

    When you redirect to this URL, use the following:

    Response.Redirect(Page.GetRouteUrl(
        "View Content", 
        new { Title=(yourtitlehere).ToString().Trim().Replace(" ","-") })
    );
    

    I added Trim(). If the title starts or ends with a space the server may think it’s a different path and return a 404: Resource not found.

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

Sidebar

Related Questions

Possible Duplicate: How does StackOverflow generate its SEO-friendly URLs? I made a simple form
Possible Duplicate: Does anyone beside me just NOT get ASP.NET MVC? I dont know
Possible Duplicate: does mvc support inheritance of Web.config settings throughout areas? In ASP.NET MVC
Possible Duplicate: What does () => mean in C#? Hi Everybody, This is my
Possible Duplicate: Does a exception with just a raise have any use? Is there
Possible Duplicate: what does #someDiv mean? i am doing this: onmouseover=evt.target.setAttribute('opacity', '0.5'); $('#someDiv').show(); onmouseout=evt.target.setAttribute('opacity','1)');
Possible Duplicate: Why does this conversion doesn't work? Hi, i discovered a strange behaviour
Possible Duplicate: What does this JavaScript/jQuery syntax mean? I specifically mean when you do
Possible Duplicate: What does this “(function(){});”, a function inside brackets, mean in javascript ?
Possible Duplicate: What does [String] mean in VB.NET? Dim assem As [Assembly] = [Assembly].GetExecutingAssembly()

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.