.htaccessについて教えてください。 URLのwww.の有り無しについては RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.ドメイン\.com RewriteRule (.*) http://ドメイン.com/$1 [R=301,L] で設定できました。 それと同時にindex.htmlの有り無しについて設定したく、以下の記述を追加したところ エラーが出ます。 (index.htmlというリンクページをhttp://ドメイン.com/で表示したい) Options FollowSymLinks RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/index.html RewriteRule ^(.*)index.html$ http://ドメイン.com/$1 [R=301,L] という記述なのですが間違っていますか? また同時に1つのhtaccessで設定する場合のルールなどありますか? 今は RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.office-aoba\.com RewriteRule (.*) http://ドメイン.com/$1 [R=301,L] Options FollowSymLinks RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/index.html RewriteRule ^(.*)index.html$ http://ドメイン.com/$1 [R=301,L] と一つ改行して入力しています。 よろしくお願いいたします。
↧