General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 17th, 2003, 11:37 AM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
mod_rewrite Problems

Hi, not sure if this is the right place to post this but I couldn't find another forum suitable (It has something to do with PHP, so I guess it fits).

Anyway, I have set up Apache 1.3.26 and enabled mod_rewrite on it. My problem is, I can get mod_rewrite to redirect the user to the php script fine, but the script doesn't pick up on the variables.

For example:

http://localhost/testmodrewrite.php?id=2&page=2 shows the following: "You are looking at test number 2, page 2.".

http://localhost/testmodrewrite/2/2/ shows the following: "You are looking at test number , page ." (No numbers.)

Here's the PHP code I am using:

PHP Code:
<?php
    
print ("You are looking at test number " $_GET["id"] . ", page number " $_GET["page"] . ".");
?>


And if it helps, here's the lines in my httpd.conf file:

Code:
<Directory "C:\wwwroot\htdocs"> 
RewriteRule ^testmodrewrite/(.*)/(.*)$ /testmodrewrite.php?id=$1&page=$2
</Directory>


Yes, I've got RewriteEngine On set and I have uncommented the mod loading lines.

Any help appreciated

Reply With Quote
  #2  
Old November 17th, 2003, 11:56 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Is it actually rewriting the URL for you?

Reply With Quote
  #3  
Old November 17th, 2003, 12:00 PM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Yes, it goes to testmodrewrite.php, but it does not pass on the variables.

Reply With Quote
  #4  
Old November 17th, 2003, 12:56 PM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I really am stupid. I replaced the <Directory> with <IfModule mod_rewrite.c> and it all works now. Amazing how simple the solution can be, eh?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > mod_rewrite Problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT