Results 1 to 13 of 13
  1. #1
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    yet another question from the dummy of ABW :)
    I am trying to get mod rewrite to work I have got it working all but for one thing.

    If the URL (usually a product name) contains a "#" symbol like in "#9" the url will not work, (it works in the original .php script using the php formating) it works for everything apart from the "#" symbol is there any way to get this to work please?

    Somebody told me about a rewrite log but as usual I have no idea what they are talking about
    the rewriteLog says
    args=ip=Scientific+Angler+Fishing+Fly+Rod+Salt+water+-+9+2+Piece+#10+Weight

    but its lost somewhere... everything followed by a % is lost...
    I've done a work around by changing the "#" to "no" but I would prefer the "#" if it is at all possible.

    This is the rule I am using for it at present.

    RewriteRule ^([^/_]+)\.htm /?ip=$1 [L]

    thanks in advance for any help.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  2. #2
    Resident Genius and Staunch Capitalist Leader's Avatar
    Join Date
    January 18th, 2005
    Location
    Florida
    Posts
    12,817
    N/m, I was going to say just make it say "no" instead but I see you're already doing that...
    There is no knowledge that is not power. ~Hemingway

  3. #3
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Leader I might look daft but I'm not 100% daft LOL
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  4. #4
    Sgt. Joe Friday frank3iii's Avatar
    Join Date
    January 18th, 2005
    Posts
    441
    Just leave out the #. Any flyfisher (and most other anglers) will know what the weight relates to.

    Frank

  5. #5
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    Gordon

    I'm not sure if this is right or not (I'm no mod rewrite expert)

    You could always modify it in the url and then do a str_replace at the output end with another php script...so eg change it in the link to read

    Scientific+Angler+Fishing+Fly+Rod+Salt+wat er+-+9+2+Piece+num10+Weight

    and then on the page that receives the info, have a php script that says :

    <?php

    $ip=str_replace('num','#',$ip);

    ?>

    Then it should read

    Scientific+Angler+Fishing+Fly+Rod+Salt+wat er+-+9+2+Piece+#10+Weight

    at the receiving end when you do call it.

    Don't know if that's what you are after...my 2 cents. Someone with more mod rewrite experience could probably work a solution out for you

    Oscar

  6. #6
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Thanks Oscar that is what I had done but I'm thinking in the future if I come across anther one then I'm screwed because as far as I know we can only use the str_replace for one change. If I'm wrong about this please let me know how to do it.

    I was just hoping someone would know how to get around it with the mod rewrite then I would not have to go through all the sites I am going to use it on.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  7. #7
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    (never mind, totally misread the problem)
    Tim
    consultant by day, affiliate by night

  8. #8
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    Is this exactly what the rewrite log says?

    Scientific+Angler+Fishing+Fly+Rod+Salt+wat er+-+9+2+Piece+#10+Weight

    Why is there a blank in 'wat er'? That would translate to wat%20er and whenever I do rewrites I always take out spaces...

    If it is the # that's causing the problem it could be that # in most urls read as 'bookmarks'? I don't know if it will work but maybe 'escape' the character with \#. I don't know if it will work - I've never used the exclude ^ before in my mod rewrites and I usually specify what I want in the string rather than what I don't want ie [A-Za-z0-9_\+\#]+

    ^([\#^/_]+)\.htm /?ip=$1 [L]

    I hope it works for you but like I said, I'm not a mod expert...
    Oscar

  9. #9
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Thanks anyway Oscar I cannot get it to work, maybe I'll have to stick with the way I am doing it now. I'ts not the best way but it works until I come across another symbol then I'm screwed LOL
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  10. #10
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    str_replace will take arrays, so you can do $ip = str_replace(array('foo','bar'), array('foof', 'barf'), $ip); etc. as needed if you find another symbol that's causing problems.
    Tim
    consultant by day, affiliate by night

  11. #11
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Thanks infospongellc I do mine like this
    <?php print stripslashes(str_replace("xxxxxx","xxxxxx",$row["producturl"])); ?>

    If I were to do this would it work do you know? or am I not doing it the way you mean?
    <?php print stripslashes(str_replace(array('foo','bar'), array('foof', 'barf'),$row["producturl"])); ?>

    oops I left my ID in LOL
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  12. #12
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    I think that's what you're after. It would change foo -> foof and bar -> barf in the product url string.

    - Tim
    Tim
    consultant by day, affiliate by night

  13. #13
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    That is a great bit of code infospogellc, I did not know you could use something like that to create more than one alteration. Thank you. That solves all my problems now if another wierd symbol comes up in the future.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

+ Reply to Thread

Similar Threads

  1. Dummy Course for Reversals?
    By glittered in forum AvantLink -AV
    Replies: 2
    Last Post: August 3rd, 2013, 04:46 AM
  2. A Little Help Please ... Big Dummy Can't Remember.
    By net4biz in forum Midnight Cafe'
    Replies: 5
    Last Post: July 27th, 2009, 11:17 AM
  3. Data Feed Dummy?
    By gettnthar in forum Commission Junction - CJ
    Replies: 13
    Last Post: October 16th, 2002, 08:03 PM

Posting Permissions

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