Forum Moderators: phranque

Message Too Old, No Replies

how to do this?

the redirect used by xomba.com

         

mp3mechanical

10:31 am on Sep 13, 2007 (gmt 0)

10+ Year Member



hello all,

i want to use a article title based redirection for my site.

currently i navigate through their respective id in database ( http://www.example.com/article/1423 )

but when i visited [a menswear site] i got amazed as they are redirecting 1000's of articles or pages just based on full text queries.( example.com/mens_formal_wear_how_to_dress_with_style )

can anybody have any guess, how they are doing this.

as i guessed they may be using fulltext searches on database based on article's title ..but i am amazed that on such a big site & around 90000 articles; mysql dont have any problem with that?

please suggest me for this

thank you.

[edited by: jdMorgan at 2:18 pm (utc) on Sep. 13, 2007]
[edit reason] example.com [/edit]

jdMorgan

2:16 pm on Sep 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They could be doing a search, or they could simply be looking up the title in the database to get the actual filepath.

There are many ways to do this, but the efficient ones all involve having that title in the database.

Three methods I know of are:

  • Use AcceptPathInfo on Apache 2 or later.
  • Use mod_rewrite to rewrite all extensionless URL requests to your main page-creation script(s), and let the script look up the actual filename in the database.
  • Use mod_rewrite's RewriteMap directive to call a small (usually PERL) script to access the database and translate it to a filepath within the URL-to-filename translation phase of the Apache API.

    Note that front-end processing must be used during title creation to be sure that no-one creates titles such as "cgi-bin" or others which might allow a malicious visitor to poke around in your system files. This can be done at the same time that the title is checked for malicious character-sequence injections.

    Jim

  •