Re: OT(?): mod_rewrite not passing GET variables to php
| From: | Leif K-Brooks | Date: | Wed, 01 Oct 2003 21:16:35 +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-164633@lists.php.net to get a copy of this message | ||
Steven Jarvis wrote:
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? thanks, Steven 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] -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.