0

URLから特定の文字列「.html」を削除しようとしています

現在の例の URL:

http://www.buildingmaterialsonline.com.au/insulation/by-brand/pink-batts/l/price-6,10///.html?dir=asc&order=price

に:

http://www.buildingmaterialsonline.com.au/insulation/by-brand/pink-batts/l/price-6,10///?dir=asc&order=price

私の現在のhtaccessファイルは次のとおりです。

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

#If request contains ref param
RewriteCond %{THE_REQUEST} \?([^&\ ]+).html=  [NC]  
#redirect to URL without the html param
RewriteRule ^  %{REQUEST_URI}?%1 [L,R=301] 

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

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>

任意の助けをいただければ幸いです

4

2 に答える 2

0

Magento には、カテゴリおよび製品 URL から .html を削除するための簡単なオプションが用意されています。

.htaccess を使用する必要はありません。

[システム] --> [構成] に移動します

次に、左メニューの [カタログ] をクリックします。

次に、[検索エンジン最適化] タブで、[商品 URL サフィックス] と [カテゴリ URL サフィックス] から「.html」を削除します。

「設定を保存」ボタンをクリックします。

注: 必要に応じて、これらのエントリに他のサフィックスを設定できます。

于 2014-02-12T07:55:36.847 に答える
0

これを行うために htaccess を使用する必要はありません。

Magento には、バックエンドにこれらのサフィックスを追加するオプションがあります。デフォルトでは .html です。

この記事では、それを変更する方法について説明します。

http://php.quicoto.com/how-to-remove-html-from-magento/

于 2012-05-31T01:36:45.517 に答える