Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod Rewrite - Incorporate Headine in URL



3:14 pm on Mar 10, 2005 (gmt 0)

10+ Year Member


Just wondering how you go about incorporating the name of a headline into a URL?

As an example:





'13016370' is the ID number from the DB so essentially you just select the news heading from the DB according to item number.

Any ideas?

Many Thanks.



6:47 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Actually, the script that builds the links on your pages needs to insert the headline, and then you could use mod_rewrite to remove it so that the script is called with the proper article number. But then, you have the problem of "associating" the headline with the correct article number when the headline URL is requested. You can do this using RewriteMap if you have htppd.conf access, but RewriteMap is not available in .htaccess.

If you're stuck with .htaccess, then have your page-builder create links like


and then use mod_rewrite to strip off the unneeded headline if necessary.

Another alternative is to use the script to do both functions, if you can retrieve an article by headline.



Featured Threads

Hot Threads This Week

Hot Threads This Month