0

Magento が WAMP にインストールされ、正常に動作しています。

サイト URL = localhost/shop <-||-> 管理者 URL = localhost/shop/index.php/admin

このマジェントを Godaddy サーバーに移動しました。ルートフォルダーにはありません。サイトは「shop」という名前のサブフォルダーにあります</p>

サイト URL = mydomain.com/shop <-||-> 管理者 URL = mydomain.com/shop/index.php/admin

フロントエンド URL は正常に機能しています - mydomain.com/shop/customer/account/login/

「index.php」が含まれていると、管理者 URL が機能しません。「index.php」を削除して手動で URL を呼び出すと、機能します。

管理者の URL をhttp://mydomain.com/shop/admin/system_config/edit/にしたい....

私の構成

Web サーバーの書き換えを使用 = はい

.HTACCESS で

RewriteBase /shop/

どうすればこれを解決できますか?

4

2 に答える 2

1

別の解決策は次のとおりです: 管理 URL から index.php を削除する方法

于 2015-05-18T15:49:12.680 に答える
0

Magento 管理 URL から index.php を削除するには、Magento フォルダーの /shop/index.php ファイルの先頭に次のコードを追加します。

<?php
    function curPageURL() {
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    } else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }
    return $pageURL;
    }

    $curUrl = curPageURL();
    $pos = strpos($curUrl, "index.php");

    // Note our use of ===.  Simply == would not work as expected
    // because the position of 'a' was the 0th (first) character.
    if ($pos === false) {
    //echo "The string '$findme' was not found in the string '$mystring'";
    } else {
    //echo "The string '$findme' was found in the string '$mystring'";
    //echo " and exists at position $pos";
    $newUrl = str_replace("index.php/", "", $curUrl);
    header("Location: $newUrl");
    exit;
    }
?>

楽しみ :)

于 2013-07-27T09:35:18.807 に答える