簡體   English   中英

如何從opencart主頁中刪除index.php?

[英]How to remove index.php from opencart home page?

我在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]

我檢查了鏈接數但沒有得到正確的輸出。 主頁仍為空白。 請幫我

要刪除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。

有關:

你面臨的問題很奇怪,我無法幫助你解決它,因為我沒有太多細節。

我想,首先你應該檢查你的錯誤日志,如果有任何新的錯誤在這里分享它們。

我認為,當您在URL中沒有index.php的情況下訪問時,主頁可能會出現某種錯誤。 由於這些錯誤,網站可能無法正常工作並在您的主頁上顯示空白頁面。 啟用錯誤顯示並檢查是否顯示任何錯誤,然后在此處發布錯誤。

如何顯示PHP錯誤?

干杯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM