1

Example if user type http://myurl.com/arti

it will redirect to 404 page where i present url like

/article (simmilar kind of Links)

sundar nataraj
  • 8,524
  • 2
  • 34
  • 46
  • @Efazati - I beg to disagree - furthermore, your comment is a bit irrelevant (he is talking about 404 page!) – Kimvais Jul 24 '12 at 05:51

1 Answers1

2

You could use a catch-all URL, e.g. put url(r"^(.*)$" as your last entry in urls.py and then use some string similarity measure to find a likely url. See this question for examples. Or this one for more of them.

Or perhaps just a simple startswith() loop over known urls will do?

Your view probably should return a response with a redirect (result code 302 or 303) if there is a single match - and if there are none (or multiple) a 404 page with list of possible matches is the way to go.

Community
  • 1
  • 1
Kimvais
  • 38,306
  • 16
  • 108
  • 142
  • 1
    @SundarNatrajAmancharla see the links above. If you are looking for someone to write the code for you, better head over to [Careers 2.0](http://careers.stackoverflow.com/) – Kimvais Jul 24 '12 at 06:04