2015-04-02 130 views
0

我在Magento根文件夾中的.htaccess文件中創建了自定義重定向。 Magento的的基本URL是http://127.0.0.1/mymagento/自定義重定向不在本地主機上工作

## enable rewrites 

    Options +FollowSymLinks 
    RewriteEngine on 

    RewriteRule ^kit-rasage.html /spray-can.html [R=301,L] 

但是,當我訪問http://127.0.0.1/mymagento/kit-rasage.html它重定向到http://127.0.0.1/kit-rasage.html

文檔根目錄是在httpdconf文件

<Directory "C:/xampp/htdocs"> 
# 
# Possible values for the Options directive are "None", "All", 
# or any combination of: 
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
# 
# Note that "MultiViews" must be named *explicitly* --- "Options All" 
# doesn't give it to you. 
# 
# The Options directive is both complicated and important. Please see 
# http://httpd.apache.org/docs/2.2/mod/core.html#options 
# for more information. 
# 
Options Indexes FollowSymLinks Includes ExecCGI 

# 
# AllowOverride controls what directives may be placed in .htaccess files. 
# It can be "All", "None", or any combination of the keywords: 
# Options FileInfo AuthConfig Limit 
# 
AllowOverride All 

# 
# Controls who can get stuff from this server. 
# 
Order allow,deny 
Allow from all 

以下操作系統是Windows 7,我正在使用XAMPP。 如何解決它?

+0

你將文檔根目錄定義爲什麼? – 2015-04-02 14:09:42

+0

@PanamaJack我應該在哪裏檢查? – Muk 2015-04-02 14:12:17

+0

在你的虛擬主機文件中。可能是httpd.conf。你設置了嗎? – 2015-04-02 14:13:55

回答

0

下面的變化後,它爲我工作。

RewriteBase /mymagento/ 
RewriteRule ^kit-rasage.html /spray-can.html [R=301,L] 

在本地主機我們在htdocs文件夾其他目錄,所以我們必須添加RewriteBase /mymagento/其中mymagento爲目錄名。

相關問題