Re: Mod Rewrite help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux