Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Mod_Rewrite Folders

Why a 404?

3:55 pm on Aug 21, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:June 20, 2002
votes: 0

Hi All

I created a rule:

RewriteRule ^([0-9]+)/([0-9]+) /index.php?year=$1&month=$2 [L]

but I get a 404

But if I use:

RewriteRule ^([0-9]+)/([0-9]+).html /index.php?year=$1&month=$2 [L]

That works. Why? How do I get the folder version to work?


5:30 pm on Aug 21, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0


Try adding a trailing slash to the pattern:

RewriteRule ^([0-9]+)/([0-9]+)/ /index.php?year=$1&month=$2 [L]

If you actually have .html pages in that folder, then you'll need to use your original rule as well, or combine them using " (/\.html) " to match slash or .html.

As usual, replace the broken vertical pipe "¦" character with the solid one from your keyboard.