473,782 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a question about URL formating /category/13/ vs /category.php?id =13

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?

thanks a lot

Jan 29 '07 #1
2 2783
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?

thanks a lot
Hi,

The format /category/13/ CAN be the result of url-rewriting to make it
suitable for apache REWRITE ENGINE (mod_rewrite).

You will most probably find the rewrite rules in your apache config in the
virtual host that defines this website.
And yes, it uses a regular expression.

What is your question/problem excactly?

Try Google: mod_rewrite examples

for a wealth of examples to get you going.

Regards,
Erwin Moller
Jan 29 '07 #2
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ø
- ki******@NOSPAM betadome.com
(remove NOSPAM to contact me directly)
Jan 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2252
by: Brian Murphy | last post by:
<?php /* I need your help. I'd be very thankfull if write me this script.I need a script that displays a list of categories and subcategories like this: <select name="category"> <option value="1">Main</option> <option value="2">Main > Computers</option> <option value="4">Main > Computers > Hardware </option>
9
1738
by: Mike D | last post by:
I need a function that can format a number with the appropriate number of sig figs. Ideallty a function that takes two values the value to be converted and the number of sig figs I want it formatted to. Has anyone done this? Any leads on how to? I have been searching the net and haven't found anything yet. Thanks Mike
1
1436
by: Dave Elliott | last post by:
I have a form named Add Products where I enter Products with a Category ID, Category Name & Category Description. I want the form to open showing only the records assocated with the Category Labor field named Labor The Category ID for Labor is Labo Thanks, Dave --
53
3192
by: jaso | last post by:
Can you give any comments on this code? I used one goto, is it bad? #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <assert.h> #define NOT_NULL 1
0
1617
by: Jonathan Mark | last post by:
hi all... I wrote a seemingly simple function (below) to use Popen3() and select() to run a program and capture its exit status, stdout output, and stderr output. It worked fine until the box was upgraded to Debian sarge. Now the call to select() always takes about 13 seconds before returning the first time. The delay only occurs when the function is running within a CGI program
1
1186
by: RobG | last post by:
It seems that the Google groups web interface became inaccessible about 2007-04-24 13:15 GMT. -- Rob
0
1004
by: sakthipro | last post by:
What is Resource id #13 ?
6
2005
by: karen987 | last post by:
I have a webpage called "topicview.asp" on a news website with ASP pages, it's a simple news publishing software. You add the news from the Admin section and all the details are stored in a database. This page shows all the categories filtered out, (10 to a page) but it doesn't show the NAME of the category anywhere on the page. How can i add the name of the category? In the database the title of the secction that stores the nm_tbl_cate...
21
1564
by: Chad | last post by:
At the following url http://c-faq.com/lib/qsort2.html, they have the following Q: Now I'm trying to sort an array of structures with qsort. My comparison function takes pointers to structures, but the compiler complains that the function is of the wrong type for qsort. How can I cast the function pointer to shut off the warning? A: The conversions must be in the comparison function, which must be declared as accepting ``generic...
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.