开发者

Remove store code from URL in Magento

I have 2 sites on one Magento install that point to different domains.

Site1 => www.site1.com

Site2 => www.site2.com

Each site shows the store 开发者_运维百科code in the url of category, product, and CMS pages (www.site1.com/store1/category). Is there a way to remove the /store1/ from the url so that is just www.site1.com/category? My guess is that can be done with .htaccess somehow.


Since you have two different websites I don't think you need that anyway, I think there is a setting in system < config < web Add Store Code to Urls and you should try setting that to no and then reindex.


If you are on IIS 7 put the lines below in you web.config file Replace "nl" with your own storecode and "domain.com" with your domainname.

<rules>
    <rule name="301 remove storecode" stopProcessing="true">
        <match url="^nl/(.*)$" ignoreCase="true" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{HTTP_HOST}" pattern="www.domain.com" />
        </conditions>
        <action type="Redirect" url="http://www.domain.com/{R:1}" />
    </rule>
</rules>

Regards,


TRY THIS .htaccess

Options +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteRule ^([A-Za-z0-9_]+)/category(-([0-9]+))? category.php?store=$1&id=$3 [L] 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜