Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Bag-O-Tricks for PHP II


bzprod - 12:56 am on Mar 1, 2003 (gmt 0)


Wow...this seems exactly like something that I could use right now(query strings). I am very new to this so I have two quick questions.

1.)Shall I put the code into each one of my .php pages?

ob_start('post_process'); # function post_process($buffer) { return preg_replace("'script.php\?([^\"\']+)'e", "'script-'.implode('-', preg_split('/&¦=/', '\\1')).'.html'", $test); }

This is a typical dynamic page that is generated on my site.

view.php?PHPSESSID=ec5b133945ec65a501791ae4367af713&sr=0&pp=1&cp=1&ut=1

I have noticed that the following will call up the same page when entered directly into the address bar.
?i=1,?i=2,?i=3, etc...where the number is the user

The above super long url however is the one that is always showing in the url. Will this little script help me get everything down?

2.)Where shall I put the next two lines?


RewriteRule (script.*)-([^-]+)-([^-]+)\.html$ $1?$2=$3 [N,QSA]
RewriteRule script\.html script.php

Would this go into each .php page as well? Where about on the pages?

Thanks everyone for all the great information. Please forgive me if I am totally off the mark.

God Bless,
Patrick


Thread source:: http://www.webmasterworld.com/php/334.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com