我在Windows 10上运行Apache 2.4.33。由于我更新了Apache的新版本,因此这些htaccess行不再起作用
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([a-z]{2})/([\+a-z\ /-]+)\.php$ index.php?lng=$1&page=$2 [L]
RewriteRule ^([a-z]{2})/([\+a-z\ ]+)\.php/([\+a-z\ ]+)/([\+a-z\ ]+) index.php?lng=$1&page=$2&choice=$3&item=$4 [L]
目标是重定向
mydomain.com/fr/page.php
到
mydomain.com/index.php?lng=fr&page=page
但是使用.htaccess中的上述几行,我仅收到404错误。请注意,重写之前可以完美地工作。我在服务器上启用了modRewrite,它正在与其他站点一起使用。
非常感谢! 丹