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] Link to comment https://forums.phpfreaks.com/topic/177972-htaccess-question/ Share on other sites More sharing options...
trq Posted October 16, 2009 Share Posted October 16, 2009 This board is PHP Coding Help. .htaccess files are Apache configuration files. Link to comment https://forums.phpfreaks.com/topic/177972-htaccess-question/#findComment-938380 Share on other sites More sharing options...
dreamwest Posted October 17, 2009 Share Posted October 17, 2009 $1, $2, $3 etc.. relates to the position of the rewrite: RewriteRule ^test/(.*)/(.*)/(.*) test.php?id=$1&next=$2&test=$3 [L,QSA] So logically it would look like: RewriteRule ^test/$1/$2/$3 Also you can swich them around anyway you want: RewriteRule ^test/$3/$1/$2 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 ^files/downloads/(.*) downloads/test/test_secret_$1.php?file= [L,QSA] Your better of having the download script like this: RewriteRule ^files/downloads/(.*) downloads.php?id=$1 [L,QSA] Link to comment https://forums.phpfreaks.com/topic/177972-htaccess-question/#findComment-938469 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.