NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Small bug in my .htaccess / mod_rewrite

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-11-2006, 02:47 PM THREAD STARTER               #1 (permalink)
www.randypendleton.com

 
Archangel's Avatar
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 7,043
Archangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatness
 


Child Abuse Breast Cancer SIDS Autism Diabetes Cancer Survivorship Save a Life Adoption Child Abuse

Small bug in my .htaccess / mod_rewrite


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 Code:
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]+).htmlimage.php?picset=$4&date=$3&fulldate=$2$3$1&pic=$5.jpg [L,NC
????: NamePros.com http://www.namepros.com/programming/246301-small-bug-in-my-htaccess-mod_rewrite.html
????: NamePros.com http://www.namepros.com/showthread.php?t=246301
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?
Archangel is offline  
Old 10-11-2006, 03:23 PM   #2 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Possibly in the image path

That would be the simple solution

-Steve
stscac is offline  
Old 10-11-2006, 09:14 PM THREAD STARTER               #3 (permalink)
www.randypendleton.com

 
Archangel's Avatar
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 7,043
Archangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatness
 


Child Abuse Breast Cancer SIDS Autism Diabetes Cancer Survivorship Save a Life Adoption Child Abuse
I've tried to change image info but I failed. I've tried:

PHP Code:
RewriteEngine on
RewriteCond 
%{REQUEST_URI} ^/([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ [NC]
????: NamePros.com http://www.namepros.com/showthread.php?t=246301
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).htmlimage.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?
Archangel is offline  
Old 10-11-2006, 09:22 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
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.
Dan is offline  
Old 10-11-2006, 10:21 PM THREAD STARTER               #5 (permalink)
www.randypendleton.com

 
Archangel's Avatar
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 7,043
Archangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatnessArchangel Has achieved greatness
 


Child Abuse Breast Cancer SIDS Autism Diabetes Cancer Survivorship Save a Life Adoption Child Abuse
Originally Posted by Dan
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.
Archangel is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:59 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger