Canman2005 Posted March 27, 2010 Share Posted March 27, 2010 Hi everyone I am trying to ReWrite a URL and this is my first time trying to do something like this. Basically I have the following URL www.domain.com/results.php?q=iphone&type1[]=hardware&type1[]=software&type2[]=blue&type2[]=white&type2[]=red that I want to rewrite to www.domain.com/find/iphone/type1/hardware/software/type2/blue/white/red/ i've been playing around with RewriteRule ^find/([^/]+)/([^/]+)/ results.php?type1[]=$1&type2[]=$2 [QSA,L] but i'm just making it worse and cannot seem to find the correct way of doing it. thanks very much ed Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted March 28, 2010 Author Share Posted March 28, 2010 hi anyone got any ideas on this? Quote Link to comment Share on other sites More sharing options...
cags Posted March 28, 2010 Share Posted March 28, 2010 Are there always the same number of attributes in the query string? Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted March 30, 2010 Author Share Posted March 30, 2010 Nope, it could change and there could be more So it could be results.php?q=iphone&type1[]=hardware&type1[]=software&type2[]=blue&type2[]=white&type2[]=red or results.php?q=iphone&type1[]=hardware&type2[]=blue&type2[]=white any help would be great thanks Quote Link to comment Share on other sites More sharing options...
cags Posted March 30, 2010 Share Posted March 30, 2010 By the sounds of it, what you are attempting is impossible. You seem to have (as is common) the idea of rewritting backwards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.