Reply to Re: [PHP] Mod Rewrite help

Your name:

Reply:


Posted by Eli on 03/29/05 04:42

Brian Dunning wrote:
>>>>> How would I mod_rewrite a request for /baseball.htm into
>>>>> /query.php?q=baseball?
>
>
> This should be doing it as far as I can tell, but for some reason it's
> not...
>
> RewriteEngine on
> RewriteRule /^(.+).htm$ /query.php?q=$1

RewriteEngine on
RewriteRule ^/(.+)\.htm$ /query.php?q=$1

But note this isn't good.. since say if you got a regular page
/index.htm then it will be rewritten into /query.php?q=index so what you
better do is having a prefix of a 'virtual' directory, like was
suggested before 'sport'... and make it like this:

RewriteEngine on
RewriteRule ^/sport/(.+)\.htm$ /query.php?q=$1


-Eli.

[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

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