我编写了几个php页面来显示客户报价,在rep.php上,用户可以单击查看详细信息按钮(POST quoteID作为变量quotedetails.php?quoteID = Q123456)查看关于特定报价的详细信息。.htaccess无法将变量传递给WAMP上的重写页面
然后,我使用.htaccess将所有的PHP页面制作为html扩展名,并将rewrited url从'quotedetails.php?quoteID = Q123456'改为'quotedetails/Q123456.html',在XAMPP下一切正常,但在WAMP下,rewrited url不会显示quotedetail页面上的数据,我通过使用旧url进行测试(quotedetails.php?quoteID = Q123456),它工作正常,所以我想它必须是我的.htaccess规则的错误,因为新的html url不能传递变量(quoteID)。
这是我的.htaccess文件:
Options +FollowSymlinks
RewriteEngine on
#sideBar.php edit rep link with the styles below, e.g. all,all.html (showing all)
#or reps/$repID,$repName.html
RewriteRule ^reps/all,all.html$ rep.php?repID=all&repName=all [QSA]
RewriteRule ^reps/([A-Z]+),([A-Za-z\sA-Za-z]+).html$ rep.php?repID=$1&repName=$2 [QSA]
RewriteRule ^reps/([A-Z]+).html$ rep.php?repID=$1 [QSA]
#rep.php including page string, edit pager links in rep.php with following styles,
#\s indicating a white space therefore mod_rewrite can recognise the repName
#e.g. reps/$repID,$repName,$page.html
RewriteRule ^reps/([A-Za-z]+),([A-Za-z\sA-Za-z]+),([0-9]+).html$ rep.php?repID=$1&repName=$2&page=$3 [QSA]
#quotedetails.php rewrite this page url to Q99999.html
#e.g. quotedetails/$quoteID.html
RewriteRule ^quotedetails/(Q[0-9]+).html$ /quotedetails.php?quoteID=$1 [QSA]
#index/addquote/search/viewall/howto page rewrite *.php ---> *.html
RewriteRule ^index.html$ index.php [QSA]
RewriteRule ^addquote.html$ addquote.php [QSA]
RewriteRule ^search.html$ search.php [QSA]
RewriteRule ^viewall.html$ viewall.php [QSA]
RewriteRule ^customer.html$ customer.php [QSA]
RewriteRule ^addcustomer.html$ addcustomer.php [QSA]
RewriteRule ^howto.html$ howto.php [QSA]
RewriteRule ^nice404.html$ nice404.php [QSA]
ErrorDocument 404 /auma_quotes/nice404.html
没关系,我的代码是正确的,它是在WAMP的问题,我重新安装了它,一切工作正常现在,由于所有! – Patrick 2010-06-30 13:12:36