2012-02-09 14 views
-1

URLにURLがない場合は、http:// wwwを追加しています。リダイレクトが.html拡張子をhappends場合は何らかの理由で追加されます:Htaccess - 内線番号を削除する

example.com/about> htaccessファイル>http://www.example.com/about.html

なぜ.htmlをが追加されるのでしょうか? これは私のhtaccessである:

example.com/about> htaccessファイル>http://www.example.com/about

RewriteCond %{HTTP_HOST} ^example\.com$ [NC] 
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] 

I'ldこのような .htmlを一部せずにリンクを持っているのが好き

ありがとうございます。 ウリ

答えて

0

はこれを行います。

Rewritecond %{REQUEST_URI} !-f 
Rewritecond %{REQUEST_URI} !-d 
Rewritecond %{REQUEST_URI} !-l 
RewriteRule ^([\w\d\-]+)$ $1.html [L] 

私はあなたがあなたのh refshttp://www.example.com/whatever代わりのhttp://www.example.com/whatever.htmlを使用することをお勧めします。

+0

申し訳ありませんが、「約」の部分は単なる例です。私はグローバルな解決策が必要です。 – Uli

+0

@Uliチェックする。 – ThinkingMonkey

関連する問題