且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento重定向基本网址

更新时间:2023-11-27 18:19:16

您应该能够使用 .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. :)

干杯.