The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

preg_replace for url Rewriting...

I am currently working on making all the urls on my php site user (and search engine) friendly.

I have got the mod_rewrite part that converts the user friendly urls back into the real ones working, all I need help with is the function that converts all the links in my pages.

The function I have now is below. In my site engine, I call this function on the main page content right before gzipping it and echoing it to the browser. I also call this function when I want to convert a url ( such as one in an email before sending it). It doesn't quite work right now, and I am hoing someone can help me!