【问题标题】:remove index.php only from frontend not in backend in magento仅从前端删除 index.php,而不是在 magento 的后端
【发布时间】:2014-07-11 02:24:13
【问题描述】:

我只想从前端删除 index.php,而不是在 Magento 的后端删除。请有人帮助我解决这个问题。

我们尝试通过以下部分使用 .htaccess 解决此问题。

        <pre>
         RewriteCond %{HTTP_HOST} ^example.com$ [NC]
         RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
         RewriteCond %{HTTP_HOST} !^www\.
         RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
         RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php(/[^\s\?]+)? [NC]
         RewriteRule ^ %1/ [L,R=301]    
        </pre>

但使用此代码后,它会在管理类别部分中创建问题的管理 URL 中添加额外的反斜杠。我无法扩展所有类别。

如果我使用下面的解决方案,那么它也会从管理 url 中删除 index.php。

【问题讨论】:

    标签: magento mod-rewrite url-rewriting seo


    【解决方案1】:

    按照以下步骤从 Magento 中的 URL 中删除 index.php

    Step 1:
    * Goto to your site root folder and you can find the htaccess file there.Open it on text editor and find the line #Rewrite Base/magento.
    * Just replace it with Rewrite Base/
    
    Step 2:
    * Then goto your admin panel and enable the Rewrites(set yes for Use Web Server Rewrites).
    * You can find it at System->Configuration->Web->Search Engine Optimization.
    
    Step 3:
    * Then goto Cache management page (system cache management ) and refresh your cache and refresh to check the site.
    

    【讨论】:

      【解决方案2】:

      system -&gt; configuration -&gt; general -&gt; web -&gt; search engines optimization 'use web server rewrites' 设置为 yes 并刷新缓存。

      您需要在您的服务器上启用 mod_rewrite。

      【讨论】:

        猜你喜欢
        • 2020-04-28
        • 2020-02-14
        • 2012-08-19
        • 1970-01-01
        • 2011-12-06
        • 1970-01-01
        • 2015-07-26
        • 2012-11-13
        • 1970-01-01
        相关资源
        最近更新 更多