download.php?BID=45&filename=bug => download/BID/45/f

Discuss practical ways rearrange URLs using mod_rewrite.

download.php?BID=45&filename=bug => download/BID/45/f

Postby FUZZI » Sat Feb 12, 2005 2:58 am

Hi,
Is it possible to do s.th like that with MOD_Rewrite?
Can s.o. give me some good links which describe how to achieve this?

Thanks in advance,
FUZZI
FUZZI
 

Postby FUZZI » Sat Feb 12, 2005 2:59 am

sorry I wantet to post this:

download.php?BID=45&filename=bug => download/BID/45/filename/bug
FUZZI
 

Postby Caterham » Sun Feb 13, 2005 8:41 am

mod_rewrite will only take you back from download/BID/45/filename/bug to the dynamic download.php?BID=45&filename=bug. You've to change all links in your document to the static url. mod_rewrite cannot do this for you.

So it would be from download/BID/45/filename/bug => download.php?BID=45&filename=bug

Code: Select all
RewriteEngine On
RewriteRule ^download/BID/([0-9]+)/filename/([a-z0-9_-.]+)/? download.php?BID=$1&filename=$2 [L]


viewtopic.php?p=1858#1858
http://www.fantomaster.com/faarticles/rewritingurls.txt
http://www.fantomaster.com/faarticles/modrewrite01.txt
http://www.fantomaster.com/faarticles/modrewrite02.txt
http://www.fantomaster.com/faarticles/modrewrite03.txt
http://www.fantomaster.com/faarticles/modrewrite04.txt

Google

Bob
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 19 guests

cron