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

The Archive Base Latest Questions

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

Its my understanding that the questions in StackOverflow has the following format http://stackoverflow.com/questions/{question-id}/{slug-made-from-question-title} So

  • 0

Its my understanding that the questions in StackOverflow has the following format

http://stackoverflow.com/questions/{question-id}/{slug-made-from-question-title}

So basically the question is retrieved using the question-id. so whatever value I give the slug is immaterial.

First I would like to know whether this understanding is wrong 🙂

I have a URL

http://stackoverflow.com/questions/6291678/convert-input-string-to-a-clean-readable-and-browser-acceptable-route-data

Then I changed the slug manually like this.

http://stackoverflow.com/questions/6291678/naveen

But it changed to the original slug. Firebug showed me a permenant redirect 301 on the altered URL. How to implement this functionality?

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

    You can do this with Response.RedirectPermanent available since ASP.NET 4.0:

    http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirectpermanent.aspx

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            string id = RouteData.Values["id"].ToString();
            string passedSlug = RouteData.Values["name"].ToString();
            //get the original slug from database / dymanic method
            string originalSlug = GetSlugFromID(id);
    
            if(!originalSlug.Equals(passedSlug))
            {
                var url = String.Format("~/test/{0}/{1}", id, originalSlug);
                Response.RedirectPermanent(url, true);
            }
        }
    }
    

    On an unrelated side note, would like to think Stack Overflow is not saving the slug at database. Its created dynamically from title using something like this. I just altered the title of my question and the slug changed. It will be un-necessary to store the slug in database as it is redundant to title.

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

Sidebar

Related Questions

http://i51.tinypic.com/2ueqidt.jpg Let us assume the following relationships (diagram). A FundCompany has Funds, and Accounts.
It's my understanding that StackOverflow (SO) was built using ASP.NET. What surprised me is
its out of question that a dao will not hold any state. however, for
This is a question for the .NET philosophers: It is my understanding that Microsoft
There have been a few questions regarding this issue before; my understanding is that
HI, My question has to do with a very basic understanding of Writing data
It's my understanding that nulls are not indexable in DB2, so assuming we have
It's my understanding that common wisdom says to only use exceptions for truly exceptional
While it's my understanding that there's no fundamental reason a program written for 32-bit
In my understanding of Servlet, the Servlet will be instantiated by the Container, its

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.