Re: OT(?): mod_rewrite not passing GET variables to php
| From: | Steven Jarvis | Date: | Fri, 03 Oct 2003 11:21:48 +0000 |
| Subject: | Re: OT(?): mod_rewrite not passing GET variables to php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164887@lists.php.net to get a copy of this message | ||
On Wednesday, October 1, 2003, at 04:16 PM, Leif K-Brooks wrote:
Steven Jarvis wrote:Thanks for the help, but nope, same results. Still no variables are passed to the page. I think there may be an issue with my Apache install. I'm going to explore that today.I'm just starting to experiment with mod_rewrite on Apache 1.3.x and php 4.3.3. Register_globals is off. I have the following rules in my .htaccess file (which sits in the site's root dir along with paper.php): RewriteEngine On RewriteRule ^/([a-z]+)/([a-z]+)/$ paper.php?paper=$1§ion=$2 [L] The browser gets served up paper.php, but I can't access the variables that should be in $1 and $2. They're supposed to be GET variables, right? I've tried accessing them with $_GET["varname"] and $_REQUEST["varname"] (and directly with $varname, even though register_globals is off), but I get nothing. Can someone point out the (probably obvious) problem I'm having?Try this (I'm no mod_rewrite expert, so no promises): RewriteEngine On RewriteRule /^([a-z]+)\/([a-z]+)$/ paper.php?paper=$1§ion=$2 [L]