Mar
13
I spent more than half the day today (24 hour day) thinking and trying to find a way to get a mod_rewrite call to work properly. I felt so dumb, retarded, and plain uneducated in my attempts. I left work a little bit early so I could concentrate (no distractions, no phone calls, no "how do I send an attachment", no nothing). Even after that, I kept running into a stumbling roadblock. My friend was trying his hardest to help me out (no idea why other than possibly a sheer curiosity - it's now almost 1:00am).
What I wanted to do:
http://example.com/contacts/form/recipients/bKozlowski/
...transformed to...
http://example.com/contacts/form/index.php?contact=bkozlowski
Sounds easy, right? Yeah, I thought so too when I first started. I tried every iteration of something that looked so darned simple and could only be done just so many ways... The eventual problem?
I needed to use: RewriteBase /
I have no idea what this directive does. I have no idea why my pattern now matches and works. The RewriteLog really wasn't helpful at all except to tell me that it wasn't working...something I could have figured out without a log, obviously. Anyway, if anyone really cares, the following is the actual end result:
I both love and loathe mod_rewrite.
(Special thanks to the people over at SitePoint Forums for their immediate response!)
What I wanted to do:
http://example.com/contacts/form/recipients/bKozlowski/
...transformed to...
http://example.com/contacts/form/index.php?contact=bkozlowski
Sounds easy, right? Yeah, I thought so too when I first started. I tried every iteration of something that looked so darned simple and could only be done just so many ways... The eventual problem?
I needed to use: RewriteBase /
I have no idea what this directive does. I have no idea why my pattern now matches and works. The RewriteLog really wasn't helpful at all except to tell me that it wasn't working...something I could have figured out without a log, obviously. Anyway, if anyone really cares, the following is the actual end result:
I both love and loathe mod_rewrite.
(Special thanks to the people over at SitePoint Forums for their immediate response!)

