4

I'm having trouble spending more than nine parameters in. htaccess file with mod_rewrite apache, for example, if I pass the parameter $ 10 = "something" mod_rewrite passes the value of parameter $ 1. Is there any solution for this?

Felipe
  • 63
  • 7

2 Answers2

8

The answer is simple: You cannot.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

The only thing you can do is to group some parameters into one and then parse it later in your script.

Of course, you can try splitting your pattern into 2 rules, so one rule matches 5 or 6 parameters, and then 2nd rule matches the rest (this will work because rules are executed one by one), but that will not always work (REALLY depends on actual rewrite rule, how complex it is) and requires good knowledge on what are you doing.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
2

RewriteRule backreferences: These are backreferences of the form $N (0 <= N <= 9), which provide access to the grouped parts (in parentheses) of the pattern, from the RewriteRule which is subject to the current set of RewriteCond conditions..

Source: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309