Please Help..

New to mod_rewrite? This is a good place to start.

Please Help..

Postby mgandha » Thu Sep 04, 2003 12:13 pm

/list/table name/id.html --> list.php?table_name=tablename&id=id

How do i do this using mod_rewrite?
mgandha
 

Postby aaroncimolini » Fri Sep 05, 2003 12:54 am

http://httpd.apache.org/docs/mod/mod_re ... ewriteRule

this page is THE reference for mod_rewrite, bookmark it, read it, live it

as for your problem...

to turn this:
list/table name/id.html

into:
list.php?table_name=tablename&id=id

Try this:

RewriteRule ^/list/(.*)/(.*)\.html$ list.php?table_name=$1&id=$2

Here you will find lots of realworld examples:
http://httpd.apache.org/docs/misc/rewriteguide.html
User avatar
aaroncimolini
 
Posts: 5
Joined: Thu Sep 04, 2003 12:14 am

Postby Guest » Thu Dec 18, 2003 3:49 am

aaroncimolini wrote:RewriteRule ^/list/(.*)/(.*)\.html$ list.php?table_name=$1&id=$2




If I understand correctly, then it should be

RewriteRule ^/list/(.+)/(.+)\.html$ /list.php?tablename=$1&id=$2

Please point out if I'm wrong for I haven't tested them both.
Guest
 


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 48 guests

cron