UrlRewrite htaccess confusion
| From: | Rob Gould | Date: | Wed, 28 Oct 2009 21:00:09 +0000 |
| Subject: | UrlRewrite htaccess confusion | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-299480@lists.php.net to get a copy of this message | ||
I feel like I'm really close to a solution for the clean-url method in htaccess. I've successfully got it now so that:
http://benchwarmersports.com/packages/basketball/2010/nba-all-star-game
maps to:
http://benchwarmersports.com/packages.php?category=basketball&year=2010&title=nba-all-star-game
However, I'm finding that when I click on subsequent links from:
http://benchwarmersports.com/packages/basketball/2010/nba-all-star-game
that I land in a strange url-structure where it replicates the packages part of the url.
Can someone tell me what I might need to change about my rewrite logic to fix this issue? I'm getting lost in the world of base urls and recursive rewrites...
Present htaccess code:
Options +FollowSymlinks
RewriteEngine On
RewriteOptions MaxRedirects=10
RewriteBase /
RewriteRule ^packages/([^/]+)/([^/]+)/([^/]+)$ /packages.php?category=$1&year=$2&title=$3 [NC]