|
Posted by Kim Andrι Akerψ on 01/29/07 15:50
just_me wrote:
> Hello,
>
> I'd like to ask if anyone knows the format /category/13/ where
> probably 13 is the ID if it's actually a
> directory/file and a script automatically created it when someone
> updated his site or they just use
> a regex method to extract the number (which means 13 is virtual), in
> our case '13' and then try "select 'bla bla' from table where id='13'
> "
> which is the same as "$id = $_GET['id'];" with the second type of
> formating.
> Can I found this, if it is already scripted instead of writing it on
> my own?
> Any links? Is it hosted in any framework?
As Erwin pointed out, this is something handled by mod_rewrite in
Apache (I don't know if there's an equivalent in IIS, and if so, what
it is).
To make /category/13 point open the URL /category.php?id=13, you'd put
something like the following in a .htaccess file in the web root
directory:
RewriteEngine on
RewriteRule ^\/category\/([0-9])+ /category.php?id=$1 [L]
--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Navigation:
[Reply to this message]
|