【问题标题】:Magento 1.9 pages not loading without index.phpMagento 1.9 页面在没有 index.php 的情况下无法加载
【发布时间】:2018-04-26 04:46:50
【问题描述】:

当我在网站上启用 ssl 时,如果 url 中没有 index.php,页面将无法加载。我已将Use Web Server RewritesUse Secure URLs in FrontendUse Secure URLs in Admin 设置为YesOffloader header 设置为 SSL_OFFLOADED。我已经清除了网站和浏览器上的缓存。我检查了 phpinfo() 并启用了mod_rewrite。安全和不安全的 url 都有https://。我还用新副本替换了 .htaccess 文件,它的不同会产生任何影响。

这是我从 Stackoverflow 上的各种帖子中尝试过的,但我不确定接下来要尝试什么。

【问题讨论】:

  • 请显示 htaccess 文件

标签: ssl magento-1.9


【解决方案1】:

您使用的是 Apache 还是 Nginx? Nginx 不读取/使用 .htaccess 文件。你需要在 Nginx 配置中使用这样的东西:

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
   expires 14d;
  log_not_found off;
}

location / {
  index index.php;
  try_files $uri $uri/ @handler;
}
location @handler {
    rewrite / /index.php;
}

location ^~ /app/                { deny all; }
location ^~ /includes/           { deny all; }
location ^~ /lib/                { deny all; }
location ^~ /media/downloadable/ { deny all; }
location ^~ /pkginfo/            { deny all; }
location ^~ /report/config.xml   { deny all; }
location ^~ /var/                { deny all; }

location /var/export/ { 
  auth_basic           'Restricted'; 
  auth_basic_user_file htpasswd; 
  autoindex            on;
}

location  /. { 
  return 404;
}

location ~ .php/ {
   rewrite ^(.*.php)/ $1 last;
}

rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;

location /lib/minify/ {
  allow all;
}

【讨论】:

    猜你喜欢
    • 2018-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-09
    • 2013-11-08
    • 1970-01-01
    • 2017-01-02
    相关资源
    最近更新 更多