Mod_rewrite concepts

I’ve been reading about mod_rewrite and feel almost ready to implement it on one of my sites. I do have one last question, and an answer would make me feel much better about starting with this…

So I understand that the user will type in something friendly in the address bar (me.com/name/id), and Apache will still process it with the usual me.com?name=xxx&id=zz

But… what happens if I forget to change one of the links in my old code, and they click on one directing to me.com?name=xxx&id=zz?

Do you normally write 2 sets of rules, one for the user, and one for the links that already exist?

I’d appreciate some feedback on best practices. Thanks!

vic,

Old links would work just fine - unless the {REQUEST_URI} is matched by another RewriteRule (block) and another redirection made.

Regards,

DK

Hi dklynn, thanks for your answer. One other question… Is there a way I can stop the old links from looking the way they do by rewriting them in the address bar? Does it work that way? It’s kind of circular, so I’m not sure it’s possible.

vic,

I went through that a few years ago with another member. My first answer was NO! My second answer was a rather convoluted way to “tag” the loop with a marker in the query string which would then be used to stop the loop. The third (and best by far) was to use the {IS_SUBREQ} variable … but all that’s explained in my signature’s tutorial (with the sample code). You didn’t bother to read that, did you?

Regards,

DK