mod_rewrite acting screwy

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

mod_rewrite acting screwy

Post 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?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: mod_rewrite acting screwy

Post 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
Post Reply