homepage Welcome to WebmasterWorld Guest from 54.205.236.46
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
site search after trailing slash
java2king




msg:4183498
 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




msg:4183556
 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




msg:4184162
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved