Forum Moderators: phranque
my htaccess file looks like this:
Options Includes +ExecCGI
AddType text/x-server-parsed-html .html
RewriteEngine on
Options +FollowSymlinksRewriteBase /
RewriteRule items/(.*)\.html$ [mydomain.com...]
RewriteRule (.*)/(.*)\.html$ [mydomain.com...]
the first rule works fine, the second doesn't.
the second rule should rewrite:
www.mydomain.com/widgets/123.html
to:
www.mydomain.com/index.php?category=widgets&s=123
index.php displays normally, but the value of category ($1)becomes the first (.*) plus everything within (.*)/(.*)\.html and s is empty
ie, if i enter the URL:
www.mydomain.com/widgets/123.html
then my script says that:
$category = widgetswidgets/123.htmls=123
$s = (empty)
any idea what i'm doing wrong? any help much appreciated.
RewriteRule [httpd.apache.org] ([^/]+)/([^/]+)\.html$ index.PHP [php.net]?category=$1&s=$2
You do not need to prefix [thishost...] since it will be stripped off by mod_rewrite [httpd.apache.org] anyway.
Andreas