Hey Everyone, Lets say I have a domain such as: www.#.com/index.php?cat1=1&cat2=1 said domain is rewritten to: www.#.com/index/1/2/ with this mod_rewrite: Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index/(.*)/(.*)/(.*)$ index.php?cat1=$1&cat2=$2&cat3=$3 [L] RewriteRule ^index/(.*)/(.*)$ index.php?cat1=$1&cat2=$2 [L] RewriteRule ^index/(.*)$ index.php?cat1=$1 [L] Now as you see can have up to three categorys in this example.. Lets say I wish to add this to the end of the domain: ?rows=3 so a domain would be like this in the url www.#.com/index/1/2/?rows=3 How do I do this? I need to inorder for the website to be interactive -- for instance 3 would be how many of rows to show.. This could also be anything. I want to be able to add this ?rows whenever. Any idea how to do this without making mod_rewrite see ?rows=3 as a cat1,cat2, or cat3?? I really need help with this one so if I am not explaining myself please let m know.. I do have a prlbem with that Thanks, Trixs!
Heres the only way I can think to accomplish this: I would have to make the url look like: www.#.com/index/cat1/1/cat2/2/rows/3 then just use a mod_rewrite such as RewriteRule ^index/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)$ index.php?$1=$2&$3=$4&$5=$6 [L] That above should work but it is not elegant and will create huge urls -- not to mention having to redo the links I already have Trying to build my site from the start with this involved ..
Thanks for reply! I dont know how to make the rewrite input the correct variable that way.. For instance how would it know that there is only 2 categories and a row vs 4 categories and a row... Maybe I just dont understand mod_rewrite fully which is probably true!
What do you think of this answer? RewriteRule ^index/(.*)/(.*)/?row=(.*)$ index.php?cat1=$1&cat2=$2&row=$3 [L] would rewrite www.#.com/index/bleh/meh/?row=3 toooo www.#.com/index.php?cat1=bleh$cat2=meh&row=3 Wow, looks like it will work.. Going to try