.htaccess question.
#1
Posted 25 August 2006 - 08:41 AM
#2
Posted 25 August 2006 - 03:11 PM
RewriteEngine on RewriteRule ^sig.jpg?level=([0-9]+)$ sig.php?level=$1
#3
Posted 25 August 2006 - 03:52 PM
NGPixel, on Aug 25 2006, 04:10 PM, said:
RewriteEngine on RewriteRule ^sig.jpg?level=([0-9]+)$ sig.php?level=$1
how would i use this(after putting in .htaccess)?
RewriteEngine on RewriteRule sig.jpg sig.php
that works except on forums which is my goal. because it doesnt end with .jpg.
Edited by high6, 25 August 2006 - 03:58 PM.
#4
Posted 25 August 2006 - 03:54 PM
It just has to have an image extention to trick the forum into allowing it as an image.
#5
Posted 25 August 2006 - 04:00 PM
Demonslay, on Aug 25 2006, 04:54 PM, said:
It just has to have an image extention to trick the forum into allowing it as an image.
well using the code he posted i get a 404 error on http://www.dimensiongaming.net/vb4life/Con...pg&level=50 .
also i dont think it would work because it doesnt end in .jpg. i know how to do this but not with variables.
#6
Posted 25 August 2006 - 04:14 PM
Also some reason I get 404 when using the 'level=50' and the .php extention, yet a blank page without that.
It'll work just fine, I use it with this kind of thing n my own site.
http://demonslay.com/dinty_kit/generator-m...mp;fullset=none
That's just a nude figure (not nude nude, just nude, lol) for a generator by the way.
Notice the .png extention nested in there, and all the GET data slapped on. It works fine as long as your rewrites are done correctly.
Edited by Demonslay, 25 August 2006 - 04:17 PM.
#7
Posted 25 August 2006 - 04:50 PM
Demonslay, on Aug 25 2006, 05:14 PM, said:
Also some reason I get 404 when using the 'level=50' and the .php extention, yet a blank page without that.
It'll work just fine, I use it with this kind of thing n my own site.
http://demonslay.com/dinty_kit/generator-m...mp;fullset=none
That's just a nude figure (not nude nude, just nude, lol) for a generator by the way.
Notice the .png extention nested in there, and all the GET data slapped on. It works fine as long as your rewrites are done correctly.
but to work on a forum it has to end in .jpg. and cant have all the variables on the end. is there a way to put them before .php?
Edited by high6, 25 August 2006 - 04:50 PM.
#8
Posted 25 August 2006 - 05:18 PM
But since you insist (-.-) this is how you'd do it.
RewriteRule ^sig/level-([0-9]+).jpg$ sig.php?level=$1I just cleaned it up as how I would do it to make it easier to remember, you could even cut it more by taking out the 'level-' completely if you wanted.
#9
Posted 25 August 2006 - 05:18 PM
RewriteEngine on RewriteRule ^/level([0-9]+)/sig.jpg$ sig.php?level=$1
*yawns after long day* lol.
EDIT: lol. Damn your Demonslay.!
Edited by .Matt, 25 August 2006 - 05:35 PM.
#10
Posted 25 August 2006 - 05:24 PM
quick question. what if i have more then 1 value?
Edited by high6, 25 August 2006 - 05:25 PM.
#11
Posted 25 August 2006 - 05:34 PM
like: page.ext?var=1&var2=2
?
#13
Posted 25 August 2006 - 06:53 PM
In regex (regular expressions) (.*) means anything, and ([0-9]+) means any numbers. The regex then stores each one of these in a variable. So the first occurance of something like this, is put into the $1 variable, the second one into the $2 variable, and so on.
So you'd have it basically working like this.
RewriteRule ^(.*)/(.*)/(.*)/(.*)$ /page.php?id=$1&cat=$2&query=$3&page=$4 [nc]
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
