homepage Welcome to WebmasterWorld Guest from 54.243.13.30
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Mod Rewrite - Incorporate Headine in URL
woldie




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

Hi

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

As an example:

FROM:

[domain.com...]

TO:

[domain.com...]

'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.

Woldie.

 

jdMorgan




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

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

/news/13016370/some_headliner_goes_here.html

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.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved