...

mod rewrite excluding page

_Dan
09-21-2006, 12:00 PM
I have this in mod rewrite:

RewriteEngine on
RewriteRule (.*)/(.*)$ /index.php?$1=$2 [L]

However my web host provide a page mydomain.com/stats
which provide web statistics.

But the mod rewrite seems to screw this up, the stats url just displays the main page. (it works fine with mod rewrite disabled!)

SO my question is: how can I modify this code so the page /stats is excluded!

Thanks :)

schleppel
09-21-2006, 07:45 PM
This will exclude all real files and directories:
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /index.php?$1=$2 [QSA,L]

_Dan
10-11-2006, 03:56 PM
I have just tried it, and at first it seemed to work...

But now I keep getting messages like

"The requested URL /somedir/somefile.gif was not found on this server."

as if mod_rewrite has been disabled... I have now reverted back to the previous .htaccess but the problem remains.

It appears that modifying the .htaccess has somehow done this... Any ideas why?

Thanks

_Dan
10-11-2006, 04:01 PM
This is strange. I tried adding "RewriteBase /" and it's working. But I didn't have that before. :confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum