Unstoppable Domains

Small bug in my .htaccess / mod_rewrite

Spaceship Spaceship
Watch

Archangel

randypendleton.comTop Member
Impact
1,774
I run a small script that I built up to run a small image gallery. For this thread, let's assume I'm using the domain site.com. I ran the script on an old domain; I figured I'd put the script back online, using a different domain.

With mod_rewrite, the URL to the page that display the appropriate image looked like this:

http://www.site.com/2006/02/11-2/13.html

The full mod_rewrite looks like this:

PHP:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ [NC]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ image.php?picset=$4&date=$3&fulldate=$2$3$1&pic=$5.jpg [L,NC]

When I type in one of my mod_rewritten links, I'm taken to the proper page but the image variable doesn't pass. This error didn't occur with the last time the scripts ran, although I'm using a different variable for the images this time. I haven't even touched PHP/.htaccess in a long time and I'm not sure where the problem lies, although I'm sure it has to be a problem with the variable. The variable I use to display the images (the one I need to pass) is $picturename[$x] Could anyone help me solve this problem?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Possibly in the image path

That would be the simple solution

-Steve
 
0
•••
I've tried to change image info but I failed. I've tried:

PHP:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ [NC]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ image.php?picset=$4&date=$3&fulldate=$2$3$1&pic=$picturename[$x] [L,NC]

And as well, I tried it with $picturename alone (minus [$x]) -- neither work. Any suggestions?
 
0
•••
I could help you, but I'd need to see the PHP file to see what you're trying to do with $picturename[$x]. $picturename and $x don't exist in the .htaccess.
 
0
•••
Dan said:
I could help you, but I'd need to see the PHP file to see what you're trying to do with $picturename[$x]. $picturename and $x don't exist in the .htaccess.

Check your PM. :)
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back