Rewrite Mode issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
asphpguy
Forum Newbie
Posts: 2
Joined: Mon May 18, 2009 12:08 pm

Rewrite Mode issue

Post by asphpguy »

Hi everybody:
I'm challenging with something weird to me. I spent lot of time to figure this out by myself but no luck. I really need some help here. This is my code on htaccess (I've numbered it here to make it easy to point to the rows. There is no numbers on the real file):

1. RewriteEngine on
2. RewriteBase /
3. RewriteRule ^(.*)/(.*)\.htm?$ profile.php?&uid=$1&pfname=$2 [L,NC]
4. RewriteRule products/([0-9]+)?$ productslist.php?subcatID=$1 [L,NC]
5. RewriteRule buy/([0-9]+)?$ productsbuy.php?productID=$1 [L,NC]


the weird thing is that they all working quite fine on my local machine (Windows Vista Ultimate + xampp) and all work quite fine on production serever (Linux/Apachi) except line # 5!! I really don't know why #4 works fine but #5 doesn't?! I cannot see any difference there, am I missing a point?
BTW, the error that I'm getting is "No input file specified." when trying to reach "buy/11" or any other product id number. I double checked everything serveral times and I'm positive that "productsbuy.php" exists on the server and I double checked the character case and ... everything.
I do appreciate any help.

Best
asphpguy
Forum Newbie
Posts: 2
Joined: Mon May 18, 2009 12:08 pm

Re: Rewrite Mode issue

Post by asphpguy »

Guys:
this issue is resolved now. Just to let the others who may have the same problem know: I simply replaced the "buy" with "shop" on the link and on the htaccess and it fixed the issue! Does any body know why? I have no idea personally but it took several hours of my time to find this out.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Rewrite Mode issue

Post by s.dot »

Hmm.. 4 and 5 are missing a ^ at the beginning. So your number 5 was probably being gobbled up by 4. Just a guess, really.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply