Page 1 of 1

mod_rewrite acting screwy

Posted: Mon Dec 21, 2009 6:33 pm
by s.dot

Code: Select all

RewriteEngine On
RewriteRule ^forum(/)?$ forum.php
Works good.

Try to add..

Code: Select all

RewriteEngine On
RewriteRule ^forum/([0-9])/.+$ forum.php?cat=$1 [L]
RewriteRule ^forum(/)?$ forum.php [L]
Everything redirects to forum.php (no get vars)..

Here's where the screwy part comes in

Code: Select all

RewriteEngine On
RewriteRule ^forum/([0-9])/.+$ forumz.php?cat=$1
RewriteRule ^forum(/)?$ forumz.php
This still redirects to forum.php (i purposely put in a bad forumz.php script name to see if i would get a page not found error, but I didn't).. so then I tried..

Code: Select all

RewriteEngine On
RewriteRule ^forum/([0-9])/.+$ forumz.php?cat=$1
RewriteRule ^forum(/)?$ forumz.php
asdfadsfa
And, as expected, I got an Internal Error 500.. so the server is reading my .htaccess file.

Why isn't it respecting the changes, or reflecting the bad urls I put in, or making the correct rewrite rules work?

Re: mod_rewrite acting screwy

Posted: Sun Jan 03, 2010 12:27 am
by daedalus__
thats weird. on my host sometimes it seems like it takes a minute for changes to my htaccess to take effect. i dont know why