View Full Version : Trouble with mod_rewrite

01-17-2005, 05:40 AM
Hi there, I am running the following .htaccess file in the root directory of my site:

# Customized server error messages:
ErrorDocument 404 /index.php

# Rewrite rules
RewriteEngine on
RewriteRule ^/books/([0-9]+)$ /books/view.php?b=$1

The customised error page shows up fine but the rewrite rule just keeps giving me 404's. I am trying to replace:




Any help would be appreciated!

02-08-2005, 02:49 AM
try this instead:

RewriteRule ^books/([0-9]+)$ /books/view.php?b=$1

Your regex looks fine, just need to take out the leading / when using ^ as I don't think apache passes this along to mod rewrite