Reply to Re: [PHP] Mod Rewrite help

Your name:

Reply:


Posted by Richard Davey on 10/04/14 11:11

Hello Brian,

Monday, March 21, 2005, 6:05:59 PM, you wrote:

BD> I know this isn't exactly a PHP question, but it's for a PHP site if
BD> that helps.... :) :)

BD> How would I mod_rewrite a request for /baseball.htm into
BD> /query.php?q=baseball?

Definitely more than one way to skin this cat, but the following will
work:

RewriteEngine on
RewriteRule ^baseball.htm/ /query.php?q=baseball [L]

If you want to make it a bit more dynamic you could do this:

RewriteRule ^sport/(.*)$ /query.php?q=$1 [L]

Then you can do sport/baseball.htm or sport/football.htm and it'll be
passed to query.php each time.

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация