【问题标题】:How to redirect the admin page in Magento 1.9.1.0如何在 Magento 1.9.1.0 中重定向管理页面
【发布时间】:2015-09-16 15:22:47
【问题描述】:

我正在使用 Magento 1.9.1.0 模板。 如何重定向后端管理页面。

目前我正在登录 domainname.com/index.php/admin

但是,我想问 domainname.com/admin

【问题讨论】:

    标签: php magento magento-1.9


    【解决方案1】:

    以下是步骤:

    1.登录管理面板

    2。点击系统->配置选项卡

    3.在出现的屏幕上,单击管理面板左侧“常规”下的“Web”选项卡。您将看到以下屏幕:

    4.现在将“搜索引擎优化”下的“使用 Web 服务器重写”选项设置为“是”。

    5.然后,将“安全”下的“在前端使用安全 URL”选项设置为“是”。点击右上角的“保存配置”按钮:

    6.现在我们需要在 Magento 安装的根目录中创建一个带有重写指令的 .htaccess 文件。您可以使用主机控制面板文件管理器或 FTP 来创建文件。

    将以下代码放入创建的文件中:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    如果您的 Magento 安装在子文件夹中,例如'shop',你应该使用以下代码:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /shop/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /shop/index.php [L]
    </IfModule>
    

    7.保存文件并检查您的网站。 “index.php”已成功从 URL 中删除。

    【讨论】:

      【解决方案2】:

      将此代码 .htaccess 放入您的 magento 根目录

         DirectoryIndex index.php
      
      <IfModule mod_php5.c>
      
          php_value memory_limit 256M
          php_value max_execution_time 18000
      
          php_flag magic_quotes_gpc off
      
          php_flag session.auto_start off
      
          php_flag suhosin.session.cryptua off
      
          php_flag zend.ze1_compatibility_mode Off
      
      </IfModule>
      
      <IfModule mod_security.c>
      
          SecFilterEngine Off
          SecFilterScanPOST Off
      </IfModule>
      
      <IfModule mod_deflate.c>
      
      </IfModule>
      
      <IfModule mod_ssl.c>
      
          SSLOptions StdEnvVars
      
      </IfModule>
      
      <IfModule mod_rewrite.c>
      
          Options +FollowSymLinks
          RewriteEngine on
      
          RewriteBase /
      
          RewriteRule ^api/rest api.php?type=rest [QSA,L]
      
          RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
      
          RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
          RewriteRule .* - [L,R=405]
      
          RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
      
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteCond %{REQUEST_FILENAME} !-l
      
          RewriteRule .* index.php [L]
      
      </IfModule>
      
          AddDefaultCharset Off
      
      <IfModule mod_expires.c>
      
          ExpiresDefault "access plus 1 year"
      
      </IfModule>
      
          Order allow,deny
          Allow from all
      
          <Files RELEASE_NOTES.txt>
              order allow,deny
              deny from all
          </Files>
      
      RewriteRule ^index.php/(.*)$ [L] 
      

      【讨论】:

        【解决方案3】:

        【讨论】:

          【解决方案4】:

          在开始之前,请确保已启用 Apache 重写模块,然后按照以下步骤操作。

          1) 登录到您的 Magento 管理区域,然后转到“系统 > 配置 > Web”。

          2) 导航到“不安全”和“安全”标签。确保 'Unsecured' 和 'Secure' - 'Base Url' 选项中包含您的域名,并且不要离开前向URL 末尾的斜线。 示例:http://www.yourdomain.in/

          3) 仍在“Web”页面上时,导航至“Search Engine Optimisation”标签并选择下方的“YES” '使用 Web 服务器重写' 选项。

          4) 再次导航到“安全”选项卡(如果还没有的话)并在“在前端使用安全 URL”上选择“'选项。

          5) 现在转到您的 Magento 网站文件夹的根目录,并将此代码用于您的 .htaccess:

          <IfModule mod_rewrite.c>
          RewriteEngine On
          RewriteBase /
          RewriteRule ^index\.php$ - [L]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule . /index.php [L]
          </IfModule>
          

          保存 .htaccess 并替换原始文件。 (请确保在使用之前备份您的原始 .htaccess 文件!!!)

          6) 现在转到“System > Cache Management”并选择所有字段并确保“Actions”下拉菜单设置为“Refresh strong>',然后提交。 (这当然会刷新缓存。)

          【讨论】:

            猜你喜欢
            • 2016-03-06
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2011-12-25
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多