我使用的OpenCart 1.5.4已安裝在/ products子目錄中。我有一個wordpress站點安裝在根目錄下。我已經剝皮他們,所以它看起來像一個網站。重寫Opencart中的所有Home鏈接
我想重寫首頁鏈接的所有實例(特別是麪包屑)到我的根目錄(而不是我的OC安裝所在的子目錄(/ products))。
從一些研究中我明白,最好的方法是在HTACCESS文件中。我對操作htaccess文件非常不熟悉。標準htaccess文件有以下重寫規則:
RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
我如何添加一條規則改變從主頁鏈接:
www.myurl.com/products/index.php?route=common/home
到:
www.myurl.com/
最後,在當前安裝此文件被稱爲.htaccess.txt。我是否必須從服務器刪除此文件,刪除.txt文件,然後上載名爲.htaccess的文件以使其正常工作?