All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index  

All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index -> Cool URLs - advanced -> /var1/value1/var2/value2 --> var1=value1&var2=value2
Author Message
admin
Site Admin


Joined: 18 Jul 2006
Posts: 89

PostPosted: Tue Jul 18, 2006 10:39 am    

/var1/value1/var2/value2 --> var1=value1&var2=value2

Reply with quote

Not possible =).

Use this:
Code:
RewriteRule ^(.*)/?$ /somefile.php?vars=$1 [L]


And then in PHP:

Code:
$vars_array = explode("/",$vars);


now you would have an array like this

Code:
$vars_array[0] = var1
$vars_array[1] = value1
$vars_array[2] = var2
$vars_array[3] = value2 ....


Btw, better is to use $_GET instead....

UPDATE: It would be probably possible without PHP.
Back to top
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.   
View previous topic
View next topic
All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
FreeMind 1.1 Template by AU Templates