New to mod_rewrite - How would I do this?

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

Postby ucahg » Thu Feb 14, 2002 12:42 pm

I can't seem to figure mod_rewrite out. I'm running Apache on Windows XP, and I want to set up mod_rewrite to do the following:

All requests to localhost/members/[directory]/[file].[ext] go to localhost/parser.php?d=[directory]&f=[file]&e=[ext]

I also want the redirection to be hidden (so the URL won't change). What I've done with mod_rewrite hasn't worked yet, so I'm hoping someone here could point me in the right direction. Thanks
ucahg
 
Posts: 1
Joined: Wed Feb 13, 2002 4:00 pm

Postby Brett » Tue Mar 26, 2002 2:26 pm

Try something like the following. I haven't tested it, but I think it will work.

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/members/([0-9a-zA-Z]*)/([0-9a-zA-Z]*).([0-9a-zA-Z]*)
RewriteRule ^(.*) parser.php?d=%1&f=%2&e=%3 [L]

I'm assuming that localhost/ is equivalent to http://yourdomain.com/ .
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 71 guests

cron