0

我正在尝试使用 OpenLiteServer 设置 Magento 2.3.0 服务器并不断遇到奇怪的重写规则错误:

LiteSpeed 错误

这是错误的完整列表

网站正在运行,但无法加载 CSS 和 JS,因此有很多 404

tyanabelle.com

我在想我可能做错了什么,或者 OpenLiteSpeed 不支持.htaccess文件中的所有这些命令。

magento 2 安装只是一个基本的 magento 2.3.0 composer 安装,没有添加任何东西,因此设置为默认模式。

文件权限看起来也不错,但请注意目录中缺少文件pub/static/frontend/luma/en_US/

权限

有什么提示吗?

谢谢

4

1 回答 1

1

假设网站位于/magento2您需要在虚拟主机上插入重写,在重写部分,也启用重写模块。

  RewriteRule ^/magento2/pub/static/version.+?/(.+)$ /magento2/pub/static/$1 [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule /magento2/pub/static/.* /magento2/pub/static.php?resource=$0 [L]
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
  RewriteRule .* - [L,R=405]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule .* /magento2/index.php [L]
于 2018-12-02T16:22:45.503 回答