homepage Welcome to WebmasterWorld Guest from 50.17.86.12
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 / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
site search after trailing slash
java2king

5+ Year Member



 
Msg#: 4183496 posted 8:33 am on Aug 7, 2010 (gmt 0)

Is it possible to enable some sort of site search for content if a user types in a keyword after the trailing slash if there was no valid folder to go to?

For example,

www.foobarbazi.com/foo will result in a set of pages that has "foo" included them.

Thanks,

J2K

 

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4183496 posted 12:44 pm on Aug 7, 2010 (gmt 0)

welcome back, java2king!
what you could do is configure your server to internally rewrite such requests to a search script that returns the page of search results.
you should be sure that a 404 Not Found response is used if no relevant content is found.
otherwise you could be serving content for nonsense urls which would all return an essentially empty template.

morehawes

5+ Year Member



 
Msg#: 4183496 posted 11:40 am on Aug 9, 2010 (gmt 0)

what you could do is configure your server to internally rewrite such requests to a search script that returns the page of search results.

Just to expand on phranque's response a little. These rewrite rules can be specified in a .htaccess file using the Apache module mod_rewrite. You can do some pretty funky stuff using this but these rely on regular expressions so get ready to get your hands dirty!

There are loads of examples online though which should help you on your way.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
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