Forum Moderators: phranque

Message Too Old, No Replies

Dynamic mod rewrite possible?

mod_rewrite in htaccess

         

phyle

4:48 pm on Mar 12, 2010 (gmt 0)

10+ Year Member



Hi all,
(Firs time here ...sorry for any mistakes.).


RewriteRule ^content\/id\/([0-9a-z-]+).html$ index.php?catalog=$1 [L]


Is it possible to have "$id" in the place of "id" ?

"$id" is from a php script to create dynamic folder when user uploads.

g1smd

8:13 pm on Mar 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The RewriteRule pattern deals with the incoming request from the user; in this case with a literal 'id' in the URL. If it is a variable piece of data at that position, capture it in a backreference using a parenthesised pattern like ([^/]+) or similar. That variable must be passed to your script for checking and processing.