...

View Full Version : 2 modrewrite scripts



lesmith
06-09-2007, 09:29 PM
Hello Peeps

I have 2 scripts which I am tring to get the mod-rewrite working.

bot have there own rewrite files but one line is causing a problem for the other.

Here are the 2 scripts.



## Script 1
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*) index.php
## End Script 1
# Script Two
RewriteRule !\.html$ - [L]
RewriteRule ^forums/[a-z0-9-]+-([pt])([0-9]+)\.html$ /forums/viewtopic.php?$1=$2 [L]
RewriteRule ^forums/[a-z0-9-]+-f([0-9]+)\.html$ /forums/viewforum.php?f=$1 [L]
RewriteRule ^forums/[a-z0-9-]+-c([0-9]+)\.html$ /forums/index.php?c=$1 [L]
RewriteRule ^forums/[a-z0-9-]+-u([0-9]+)\.html$ /forums/profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^forums/([a-zA-Z0-9_]+),([^/,]+),([^/,]*)([^/]*\.html)$ /forums/$1$4?$2=$3 [QSA,N]
RewriteRule ^forums/[a-z0-9-]+-([pt])([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ /forums/viewtopic$5?$1=$2&$3=$4 [QSA,N]
RewriteRule ^forums/[a-z0-9-]+-f([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ /forums/viewforum$4?f=$1&$2=$3 [QSA,N]
RewriteRule ^forums/([a-zA-Z0-9_]+)\.html$ /forums/$1.php [L]
##End Script 2


Script 1 works fine but 2 fails. But if I comment out the below line in script 1

RewriteRule ^([^/]*) index.php

Script 2 works and 1 Fails.

As you can see script 2 is all based in folder /forums/ (phpbb)

Hope you can advise.

Lee



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum