mod_rewrite problem
Posted by: mao
Posted on: 2007-09-09 11:35:00
I love mod_rewrite..so difficult to use :/
I have the following rules:
RewriteEngine On
RewriteRule ^books/([^/]*)$ /booklist/show.php?book=$1&page=1 [L]
RewriteRule ^books/([^/]*)/$ /booklist/show.php?book=$1&page=1 [L]
RewriteRule ^books/([^/]*)/([^/]*)$ /booklist/show.php?book=$1&page=$2 [L]
The problem is that I want to create a few redirect for
/booklist/
and
/books/
I want that if I don't write anything after /books (or /books/ ) I got redirected to the homepage. I have no idea how to do that. I tried to do
RewriteRule ^books/([^/])$ /booklist/show.php?book=$1&page=$2 [L]
or
RewriteRule ^books/$ /booklist/show.php?book=$1&page=$2 [L]
But they both don't work.
Cupons:MAO_HALFPRICE : pay only half of the price (L1 plans only) MAO97 get 97$ back