...

View Full Version : Trouble with mod_rewrite



Candrias77
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:

/books/view.php?b=130

with

/books/130

Any help would be appreciated!

Noodles24
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum