Page 1 of 1

Quick mod_rewrite Question... Limit Numbers

Posted: Wed Jun 25, 2008 6:17 pm
by tecktalkcm0391
I have this in my .htaccess file, but when you go to /12345/567/12/abc123 it doesn't send at 404, it should only work if it follows: 4numbers/2numbers/2numbers/2numbers/anything but it doesn't for the numbers parts... anyway to make sure its 4 or 2 digits any send 404 if it isn't in the format...

Thanks!

Code: Select all

Options +FollowSymLinks
RewriteEngine on
RewriteRule ([0-9]{4})/([0-9]{2})/([0-9]{2})/([0-9]{2})/([A-z0-9_.]+)$ index.php?year=$1&month=$2&week=$3&random=$4&filename=$5

Re: Quick mod_rewrite Question... Limit Numbers

Posted: Wed Jun 25, 2008 11:20 pm
by tecktalkcm0391
They are all working except the very first one....I just discovered.... how can I get the first one with 4 digits to work...

Edit: Nevermind I got it... you have to use a ^ to start the Rule or it won't work...