Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,342

    Question Small HTAccess Fix (actualy redo)

    I tried to make this rewrite:

    RewriteRule ^show.php/lat/(.*)/long/(.*)/gmt/(.*)/cityname/(.*)/countryname/(.*)/zipcode/(.*)/method/(.*)/style/(.*)/color1/(.*)/color2/(.*)/color3/(.*)/color4/(.*)/color5/(.*)$ show_pt.php?lat=$1&long=$2&gmt=$3&cityname=$4&countryname=$5&zipcode=$6&method=$7&style=$8&color1=$9&color2=$10&color3=$11&color4=$12&color5=$13 [L]


    Problem is that after $9, it shows the lat for all of the next numbers..

    Is there to make this rule recusrvise instead of specifying EVERY pramater.

    Thanks in advanced,
    Aziz
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    Err -- your rule is kinda crazy. Why would anyone enter such a long URL in the first place? For example, you can get rid of each color by using a comma separated list instead of color1/.

    Anyway -- Apache has a mod_rewrite backreference (the $1, $2 part) limit of 9, which is why you are getting this problem. There is no $10.

    Your options are .. well -- do the rewrite "manually" by passing it to a script (there are examples in the mod_rewrite manual for this) OR modify your URL so that you use only 9 backreferences.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,342

    Thumbs up

    Originally posted by fyrestrtr
    Err -- your rule is kinda crazy. Why would anyone enter such a long URL in the first place? For example, you can get rid of each color by using a comma separated list instead of color1/.

    Anyway -- Apache has a mod_rewrite backreference (the $1, $2 part) limit of 9, which is why you are getting this problem. There is no $10.

    Your options are .. well -- do the rewrite "manually" by passing it to a script (there are examples in the mod_rewrite manual for this) OR modify your URL so that you use only 9 backreferences.
    Its actually a script that someone might be able to use on there sites, not something of which a person will enter as a url..

    I have made it all into one backreference, and then used PHP to split it, much eaiser..

    Thanks alot for your help,

    Peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •