Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,108
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    I guess this is a valid design paradigm since you already need to design error handling into your PHP.

    My preference would be to never invoke PHP processing at all if the URL is invalid though; I'd either repair the bad URL, then send it to the server, or redirect to an error page.
    I chose the opposite long ago, because I want control on the Error-handling and Error-Messages. (My website has a *very* elaborate Error-Messaging system which I feel provides a better experience for the user than letting Apache give low-grade warnings.)


    Debbie

  2. #17
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,108
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    I meant that if you supply two pseudo-directories in the URL and leave off the trailing slash, then the second and fifth capturing groups match since the fifth group is the only one that doesn't require a trailing slash.

    ((.+)/)?((.+)/)?(.+) with "account/messages/trash/by-sender" results in "account/messages.php?msgview=trash&sortname=&sortdir=by-sender" which is clearly wrong.
    I don't understand that. I assumed that Apache read things from Left to Right?!

    So "trash" would go in group #2, and "trash/" would make group #1.

    "by-sender" would be group #4.

    And I assumed that group #5 would be blank...


    Debbie

  3. #18
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,108
    Thanks
    27
    Thanked 0 Times in 0 Posts
    I got it!

    Today was a good reminder of the power of echo statements!!

    I echoed out each part of my URL (e.g. $_GET['viewtype']) and then started playing with the URL - a much to my surprise - witnessed how flaky things were?!

    Through lots of trial-and-error I have a mod_rewrite that works!

    Thanks for the inspiration or whatever it was!

    Sincerely,


    Debbie


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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