こちらを参考にして表示内容を切り替えるようにしました。
しかし、構造上自動でindex.html#Japaneseのようにハッシュ値を付与しなければならないので、.htaccessを利用しindex.htmlからindex.html#Japaneseに301リダイレクトをすればできると思い実行した所失敗しました。
JavaScriptを利用すれば可能かと考えましたが知識がないためどなたかお知恵をお貸しください。
よろしくお願いします。
HTML
1<style> 2.content { 3 display: none; 4} 5 6.content:target { 7 display: block; 8} 9</style> 10<a href="#Japanese">日本語</a><a href="#English">英語</a><a href="#Chinese">中国語</a> 11<div id='Japanese' class='content'> 12日本語 13</div> 14<div id='English' class='content'> 15英語 16</div> 17<div id='Chinese' class='content'> 18中国語 19</div>
試したもの
<Files ~ "^.ht"> deny from all </Files> # Redirect Redirect permanent /index.html http://sample.com/index.html#Japanese
→「多くのリダイレクトが発生しました」
<Files ~ "^.ht"> deny from all </Files> # Redirect Redirect permanent /index.html http://ユーザー名.starfree.jp/index.html#Japanese RewriteCond %{REMOTE_ADDR} !=157.112.187.101
→「多くのリダイレクトが発生しました」
こちらで再度質問しました。
回答4件
あなたの回答
tips
プレビュー