PDA

View Full Version : URL rewriting


filburt1
12-07-2002, 01:41 PM
I have Apache 1.3.27/PHP4.3.0-rc1/MySQL on Windows 2000. I'm using an .htaccess file with these contents:

RewriteEngine on
RewriteBase /web/testvb/
RewriteRule ^forumid(.*)session(.*).html forumdisplay.php?s=$2&forumid=$1
RewriteRule ^forumid(.*)session(.*)page(.*) forumdisplay.php?s=$2&forumid=$1&pagenumber=$3
RewriteRule ^threadid(.*)session(.*).html showthread.php?s=$2&threadid=$1
RewriteRule ^threadid(.*)session(.*)page(.*).html showthread.php?s=$2&threadid=$1&pagenumber=$3

RewriteRule ^viewforum(.*).html forumdisplay.php?forumid=$1
RewriteRule ^viewforum(.*)page(.*).html forumdisplay.php?forumid=$1&pagenumber=$2
RewriteRule ^viewthread(.*).html showthread.php?threadid=$1
RewriteRule ^viewthread(.*)page(.*).html showthread.php?threadid=$1&pagenumber=$2

For some reason it takes about five seconds for the page to start loading when I try to access a url like forumid95session1.html. Am I doing anything wrong with the rewriting or is my computer just slow? ;)

Keith83
12-08-2002, 01:41 AM
Well, one thing you should make sure to do at least is use the [L] flag so you don't have to run through every single regex every time. Then make sure the most commonly accessed types of pages appear first. Other than that, your computer may just be slow. :) That's all I can think of for now.