WordPressでindex.htmlをリダイレクトする方法
既存のサイトをWordPressに置き換えたあとによく発生する問題です。
リンクや検索エンジンの登録が、”/”ルートではなく ”/index.html”に対してなされている場合があります。
このとき、WordPressは404を返してしまうんですね。
.htaccessでリダイレクト処理
じゃあ、ってんで.htaccessに単純に
Redirect permanent /index.html / |
と追加すると、リダイレクトが無限ループしてしまいます。
ここは、mod_rewriteで次のように書き換えるのが正解。
<ifmodule mod_rewrite.c=""> RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/index.html RewriteRule ^(.*)index.html$ /$1 [R=301,L] </ifmodule> |
あるいはシンプルにこれでもいけるようです。
RedirectMatch 301 ^/index\.htm.$ / |
index.htm.で、index.htmlとindex.htmとどちらでも対応できるようになっている。はず。
広告
プラグインRedirectionを使う
もう一つの方法。
WordPressのリダイレクトを管理するプラグイン、Redirectionを使います。
WordPress › Redirection « WordPress Plugins
リダイレクトのマッチ回数がカウントされるので便利ではありますが、WordPressのバージョンに問題がある場合、データベース容量に制約がある場合は使わない方が無難です。
(リダイレクトのログがどんどん溜まっていきます)
WordPressでindex.htmlをリダイレクトする方法 http://t.co/bsCNgXi
casino usa online
poker online casino
top casino site
casinos online
wonderful publish, very informative. I’m wondering why the
opposite experts of this sector don’t understand this. You should continue your writing.
I am confident, you’ve a great readers’ base already!
Fascinating blog! Is your theme custom made or did you download it from somewhere?
A theme like yours with a few simple adjustements would really make my blog stand
out. Please let me know where you got your theme. Appreciate it
It’s awesome to go to see this web site and reading the views of all friends on the topic of this article, while I am also keen of getting familiarity.
Yesterday, while I was at work, my cousin stole my iphone and tested to see if it
can survive a twenty five foot drop, just so she can be a youtube
sensation. My apple ipad is now broken and she has 83 views.
I know this is totally off topic but I had to share it with someone!
It’s perfect time to make some plans for the future and it is
time to be happy. I’ve read this post and if I could I wish to suggest you
few interesting things or tips. Perhaps you could write next
articles referring to this article. I wish to read more things about it!
Having read this I thought it was extremely enlightening.
I appreciate you spending some time and effort
to put this information together. I once again find myself spending
a significant amount of time both reading and leaving comments.
But so what, it was still worth it!
Hey there, I think your blog might be having browser compatibility issues.
When I look at your blog in Chrome, it looks
fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, superb blog!
Hi, all the time i used to check webpage posts here early in the morning, since
i like to find out more and more.
Link exchange is nothing else however it is just placing the other person’s weblog link on your page at proper place and
other person will also do similar in favor
of you.
Asking questions are actually good thing if you are not understanding something totally,
except this piece of writing gives fastidious understanding yet.
I do not even know how I ended up here,
but I thought this post was good. I don’t know who you are
but certainly you’re going to a famous blogger if you are not already 😉 Cheers!
Great blog! Do you have any recommendations for aspiring writers?
I’m hoping to start my own blog soon but I’m a little lost on everything.
Would you propose starting with a free platform like WordPress or go for a paid option? There
are so many choices out there that I’m totally confused ..
Any tips? Bless you!
Hey people!!!!!
Good mood and good luck to everyone!!!!!
Thank you for the good writeup. It in fact was once
a amusement account it. Look complicated to more brought agreeable from
you! However, how can we communicate?
This paragraph provides clear idea in support of the new visitors of blogging, that
truly how to do running a blog.
Hi there friends, how is everything, and what you would like to say
concerning this paragraph, in my view its actually amazing in support of me.
Great post. I was checking constantly this blog and I’m impressed!
Very useful information specially the last part 🙂 I care for such information a lot.
I was looking for this certain info for a long time.
Thank you and good luck.
This website was… how do you say it? Relevant!!
Finally I have found something which helped me.
Appreciate it!
Thanks for your personal marvelous posting! I quite enjoyed reading it, you might be a great author.I will make
sure to bookmark your blog and will often come back
later in life. I want to encourage you to continue your great
posts, have a nice day!
Hello, this weekend is good for me, for the reason that this occasion i am
reading this great educational paragraph here at
my house.
Your way of telling the whole thing in this piece of writing is in fact fastidious, all can simply understand it, Thanks a lot.
I’m gone to tell my little brother, that he should also pay a visit this blog on regular basis to
obtain updated from hottest reports.
I’m extremely pleased to uncover this website. I wanted
to thank you for ones time for this particularly fantastic read!!
I definitely loved every bit of it and i also have you bookmarked to look at new stuff in your site.
I am curious to find out what blog platform you are working with?
I’m having some minor security problems with my latest
website and I’d like to find something more risk-free. Do you have
any suggestions?
If some one wants expert view on the topic of running a blog after that i advise him/her to pay a visit this web
site, Keep up the nice job.
Today, I went to the beachfront with my children. I found a sea shell
and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is completely off topic but I had to tell someone!
Link exchange is nothing else except it is just placing the other person’s blog link on your
page at proper place and other person will also do same for you.
Your style is very unique compared to other people I have read stuff from.
Many thanks for posting when you have the opportunity, Guess I will just book mark
this site.
I like the helpful information you provide in your articles.
I will bookmark your weblog and check again here frequently.
I’m quite certain I will learn lots of new stuff right here!
Best of luck for the next!
Have you ever thought about adding a little bit more than just your articles?
I mean, what you say is valuable and everything. Nevertheless think about if you added
some great photos or videos to give your posts
more, “pop”! Your content is excellent but with images and
videos, this website could certainly be one of the best in its field.
Good blog!
Keep this going please, great job!
This is my first time pay a visit at here and i am genuinely happy to read everthing at alone
place.
Hi, everything is going perfectly here and ofcourse every one is sharing data, that’s genuinely good,
keep up writing.
I love reading an article that can make people think.
Also, many thanks for permitting me to comment!
If you try something that isn’t known to fail, you’ll have a better chance of winning.
Before starting card counting you should know that there are
several systems of this strategy.
Numerous insurance providers supply on the internet quotes
for van insurance, producing it quick and easy to contrast costs.
Ensure to collect several quotes just before making a choice.
4AqH6px8UNDTUn2w8LUY
4AqH6px8UNDTUn2w8LUY
4AqH6px8UNDTUn2w8LUY