我整天都在为这个问题苦苦挣扎,但仍然不知道为什么它不起作用。我将一个网站从托管部署到本地服务器以进行测试/更新。管理公园工作正常,主页工作正常,目录和组件工作正常。但是每个依赖 url -rewrite 引擎的组件都无法工作。它将我发送到 404。例如,我可以查看 /catalog/ 目录,但如果我请求 /commodity/good/ 我被发送到 404,新闻组件等也会发生这种情况。我尝试了服务器配置的许多变体,但结果要么同样的任一服务器错误。
我将我的实验重置为默认配置,看来它必须工作
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory "C:\VertrigoServ\www">
Options Indexes FollowSymLinks Includes
AllowOverride All
Require all granted
</Directory>
它似乎有效,但以一种奇怪的方式。如果我将重定向指令添加到 .htaccess,它会执行该重定向。但是 Bitrix 无论如何都不能正常工作。
这是我在主 .htaccess 文件中留下的内容
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag allow_call_time_pass_reference 1
php_flag session.use_trans_sid off
#php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
</IfModule>
如果您遇到类似的问题,请帮助我找到解决方案...