View Single Post
Old 07-12-2007, 09:31 AM   #1 (permalink)
darmar
Platinum Lifetime Member
 
darmar's Avatar
 
Name: Darko Martic
Last Online: 09-29-2008 04:57 AM
iTrader: (1)
Join Date: Dec 2006
Posts: 90
DNF$: 100
Location: Zagreb, Croatia
Country:


HTACCESS RewriteRule problem

I need some more help....

I can't get to "reuse" variables I'm passing through....

here's my example:
Quote:
RewriteEngine On
RewriteRule ^[a-zA-Z]{5}$ /test.php?myvar=%1 [R=301,L]
(yes, I'm trying to redirect all "www.example.com/abcde" calls to a specific PHP script, with that "abcde" pass as variable)

with this, I get redirected to: "test.php?myvar=" and no value for this variable "myvar"....

I also tried using "$" instead of "%" in RewriteRule statement - but I get the same....

could anybody post a working example of passing variables to script you're redirecting with RewriteRule ?


thank you



=================
reply added:
=================

here's the solution for my latest problem:

Quote:
RewriteEngine On
RewriteRule ^([a-zA-Z]{5})$ /test.php?myvar=$1 [R=301,L]
I forgot to use ( ) and I should use $ instead if %
__________________
Martic.net - Talking in binary since 1980.
TXTberry.com - Text-based services for blackberry and other mobile devices (whois, etc.).

Last edited by darmar; 07-12-2007 at 10:43 AM. Reason: Automerged Doublepost
darmar is offline   Reply With Quote
Sponsored Links