Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-21-2006, 12:00 PM   PM User | #1
_Dan
New Coder

 
Join Date: Feb 2005
Location: UK
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
_Dan is an unknown quantity at this point
mod rewrite excluding page

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
__________________
Daniel
XZIST.org
_Dan is offline   Reply With Quote
Old 09-21-2006, 07:45 PM   PM User | #2
schleppel
Regular Coder

 
Join Date: Oct 2004
Posts: 330
Thanks: 0
Thanked 13 Times in 13 Posts
schleppel is an unknown quantity at this point
This will exclude all real files and directories:
Code:
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /index.php?$1=$2 [QSA,L]
schleppel is offline   Reply With Quote
Old 10-11-2006, 03:56 PM   PM User | #3
_Dan
New Coder

 
Join Date: Feb 2005
Location: UK
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
_Dan is an unknown quantity at this point
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
__________________
Daniel
XZIST.org
_Dan is offline   Reply With Quote
Old 10-11-2006, 04:01 PM   PM User | #4
_Dan
New Coder

 
Join Date: Feb 2005
Location: UK
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
_Dan is an unknown quantity at this point
This is strange. I tried adding "RewriteBase /" and it's working. But I didn't have that before.
__________________
Daniel
XZIST.org
_Dan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:29 PM.


Advertisement
Log in to turn off these ads.