Magento重定向基本网址 [英] Magento Redirect base url

查看:74
本文介绍了Magento重定向基本网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的文件夹和文件都放在 www.mysite.com/magento/中,并且我的主页基本URL是 www.mysite.com/magento/.我需要将此URL更改为仅 www.mysite.com ,并且如果可能的话,我不想将文件从/magento/移至后退文件夹.

I have all my folders and files in www.mysite.com/magento/ and my home page base url is www.mysite.com/magento/. I need to change this url to only www.mysite.com and if possible I don't wanna move my files from /magento/ to the back folder.

如果我从magento-admin-panel中使用系统-配置-Web",它将无法工作,并且无法连接到面板.

If I use System - Configuration - Web from my magento-admin-panel, it doesn't work and I can't connect to panel.

推荐答案

您应该能够使用 .htaccess RewriteBase 来实现.

You should be able to accomplish that using .htaccess and RewriteBase.

以下是Magento .htaccess 示例中的注释示例:

Here's commented out example in Magento .htaccess sample:

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

RewriteBase /magento/

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

That should do the trick in your case.

您可以在此处了解有关 RewriteBase 的更多信息:

You can read more about RewriteBase here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#page-header

在网络根目录中,您需要对Magento根目录进行某种重写:

In the web root, you'll need some sort of rewrite to Magento root directory:

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

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

Keep in mind that there are all just untested examples that should point you in the right direction. :)

干杯.

这篇关于Magento重定向基本网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆