【问题标题】:Magento Redirect base urlMagento 重定向基本网址
【发布时间】:2018-09-19 23:00:17
【问题描述】:

我的所有文件夹和文件都在www.mysite.com/magento/ 中,我的主页基本网址是www.mysite.com/magento/。我需要将此网址更改为仅www.mysite.com,如果可能的话,我不想将我的文件从/magento/ 移动到后面的文件夹。

如果我从我的 magento-admin-panel 使用 System - Configuration - Web,它不起作用,我无法连接到面板。

【问题讨论】:

    标签: magento url redirect


    【解决方案1】:

    您应该能够使用.htaccessRewriteBase 来完成此操作。

    这是 Magento .htaccess 示例中注释掉的示例:

    ############################################
    ## you can put here your magento root folder
    ## path relative to web root
    
    RewriteBase /magento/
    

    这应该可以解决您的问题。

    您可以在此处阅读有关RewriteBase 的更多信息:http://httpd.apache.org/docs/current/mod/mod_rewrite.html#page-header

    编辑:在 web 根目录中,您需要对 Magento 根目录进行某种重写:

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !magento/
    RewriteRule (.*) /magento/$1 [L]
    

    请记住,所有未经测试的示例都应该为您指明正确的方向。 :)

    干杯。

    【讨论】:

    • 不幸的是它不起作用。如果我去 'www.mysite.com' 出现'您无权访问此服务器上的 /
    • 我已经编辑了更多详细信息的答案,无法将其全部添加到评论中。 :)
    猜你喜欢
    • 2014-06-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多