Gamerz Posted October 16, 2009 Share Posted October 16, 2009 First, What does $1 and $i mean. What are the differences between them. Second, I want to cover the real path: http://www.domain.com/downloads/test/test_secret_09.php?file= and mask it with: http://www.domain.com/files/downloads/09 --- So far, I have this: RewriteRule ^downloads/([^/]+)/([^/]+).zip test_secret_09.php?file= [NC] Quote Link to comment https://forums.phpfreaks.com/topic/177975-htaccess-question/ Share on other sites More sharing options...
trq Posted October 16, 2009 Share Posted October 16, 2009 Pattern matches that you capture (ie, are found within ()) show up within $1, $2, $3 etc etc From what you have given us its pretty hard to tell what you want to match. Should the file param within http://www.domain.com/downloads/test/test_secret_09.php?file= point to 09 given your example? Your rule would be something like.... RewriteRule ^downloads/files/downloads/([^/]+) /downloads/test/test.php?file=$1 [NC] Quote Link to comment https://forums.phpfreaks.com/topic/177975-htaccess-question/#findComment-938390 Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 Depends on the context. $1 and $i are both variable names. $1 is used by regular expressions to represent a pattern set in the rewrite rule for example $1 would represent the pattern matched by the pattern inside the first set of parentheses (), $2 would match the contents of the second set etc etc. To my knowledge $i cannot be used in a .htaccess file, but my knowledge is limited so I could be wrong. Edit: D'oh Quote Link to comment https://forums.phpfreaks.com/topic/177975-htaccess-question/#findComment-938395 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.