
07-17-2004, 03:24 PM
|
 |
Premium member
|
|
Join Date: May 2004
Location: Ritzville, Washington, U.S.A.
Posts: 208
|
|
Better is to disguise altogether the php extension. The exact code would depend on to what extent you want to failsafe the characters used in category; if we assume, for discussion, that category must be entirely numeric, then you could use:
RewriteRule ^([0-9]+)\.html$ /category.php?id=1&cat=$1 [L]
That would rewrite a call of the form: http://www.domain.com/73496.html
to a call to--
http://www.domain.com/category.php?id=1&cat=73496 A necessary assumption here is that you have no actual files in your root directory whose names are just some numerals followed by .html.
If category can be more complex than just numerals, then the term shown above as [0-9]+ would need to be a "regular expression" denoting the possible form. (For another example, if category were limited to capital letters and numerals, that term would be [0-9A-Z]+).
|