首页 文章

如何从opencart主页中删除index.php?

提问于
浏览
1

我在opencart设置中启用了seo url . 我还返回.htaccess文件 . 但仍然在主页末尾的index.php . 一旦我点击主页,它就会变成空白,直到我在DNS之后写下index.php . 如果有任何人可以帮助我,我会在哪里出错 .

RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

我检查了链接数但没有得到正确的输出 . 主页仍为空白 . 请帮我

2 回答

  • -1

    要删除index.php,可以在此文件中替换

    /catalog/controller/common/seo_url.php

    找:

    return $link;
    

    之前在新线上放:

    $link = str_replace('index.php?route=common/home', '', $link);
    

    编辑如果你想要完整的SEO只需使用这一行代替上述:

    $link = str_replace('index.php?route=', '', $link);
    

    还要确保在商店的“管理”面板中启用了SEO URL .

    有关:

  • 1

    你面临的问题很奇怪,我无法帮助你解决它,因为我没有太多细节 .

    我想,首先你应该检查你的错误日志,如果有任何新的错误在这里分享它们 .

    我认为,当您在URL中没有index.php的情况下访问时,主页可能会出现某种错误 . 由于这些错误,网站可能无法正常工作并在您的主页上显示空白页面 . 启用错误显示并检查是否显示任何错误,然后在此处发布错误 .

    How do I get PHP errors to display?

    干杯 .

相关问题