我无法让我的 .htaccess 文件正常工作。请有人可以帮我纠正它。
我使用http://htaccess.madewithlove.be/尝试使其正确,但没有成功。
http://www.mydomain.co.uk/bootstrap/rolex-watch.php 应在地址栏中显示为 http://www.mydomain.co.uk/bootstrap/rolex-watch 并显示劳力士手表。页面
http://www.mydomain.co.uk/bootstrap/products.php?f=Watch&b=Tissot&t=T-Touch 应该在地址栏中显示为 http://www.mydomain.co.uk/bootstrap/products/ Watch/Tissot/T-Touch 并显示带有 f 和可选参数 b 和 t 参数设置的产品页面。
.htaccess 文件内容
ErrorDocument 404 /bootstrap/404.php
ErrorDocument 403 /bootstrap/403.php
Options +FollowSymLinks
Options +Indexes
RewriteOptions inherit
RewriteEngine on
RewriteRule ^bootstrap/products/(.*)/(.*)/(.*)$ bootstrap/products.php?f=$4&b=$5&t=$6
RewriteRule ^bootstrap/products/(.*)/(.*)$ bootstrap/products.php?f=$4&b=$5
RewriteRule ^bootstrap/products/(.*)$ bootstrap/products.php?f=$4
RewriteRule ^bootstrap/products/search/(.*)$ bootstrap/products.php?s=$1
Redirect bootstrap/rolex-watch.php http://www.mydomain.co.uk/bootstrap/rolex-watch
Redirect bootstrap/scrap-gold.php http://www.mydomain.co.uk/bootstrap/scrap-gold
Redirect bootstrap/eternity-ring.php http://www.mydomain.co.uk/bootstrap/eternity-ring
Redirect bootstrap/engagement-ring.php http://www.mydomain.co.uk/bootstrap/engagement- ring
Redirect bootstrap/wedding-ring.php http://www.mydomain.co.uk/bootstrap/wedding-ring
Redirect bootstrap/diamond-ring.php http://www.mydomain.co.uk/bootstrap/diamond-ring
Redirect bootstrap/inferno-diamonds.php http://www.mydomain.co.uk/bootstrap/inferno- diamonds
Redirect bootstrap/radley-products.php http://www.mydomain.co.uk/bootstrap/radley-products
RewriteRule ^([^\.]+)$ $1.php [NC,L]