RewriteRule无法执行

时间:2014-09-25 17:56:46

标签: apache .htaccess mod-rewrite rewrite

我写了一条重写规则来修改它:

https://www.mydomain.com/template.php?staticPage=product.php&code=12345&title=product%20name%20and%description

到此:

https://www.mydomain.com/product.php/12345/product%20name%20and%20description.html

以下是规则:

RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /LG_Template.php?staticPage=$1&code=$2&title=$3 [L]

这里与.htaccess文件的其余部分有关:

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule (^includes/.*)                  $1                          [L]
RewriteRule (^static/.*)                    $1                          [L]
RewriteRule ^Topic\ Pages/([^/\.]+)\.htm$   /category.php?oldname=$1    [L]
RewriteRule ^([^/\.]+)\.htm$                /template.php?staticPage=product.php&code=$1    [L]
RewriteRule ^([^/\.]+)\.html$               /template.php?staticPage=product.php&code=$1    [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$                         /template.php?staticPage=$1&code=$2&title=$3 [L]

问题是没有重写。我在类似问题的帖子中找到的.htaccess开头尝试了几个不同的选项指令,例如:

Options +FollowSymLinks
Options -MultiViews

这些似乎都没有对这个问题产生任何影响。可能导致这种情况的任何想法?

0 个答案:

没有答案