homepage Welcome to WebmasterWorld Guest from 54.204.73.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

10+ Year Member



 
Msg#: 3061 posted 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

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



 
Msg#: 3061 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved