开发者

Apache mod_rewrite help with Wordpress

I administer my wife's site, namelymarly.com. Up until last week, the root page of the blog was namelymarly.com/blog/.

Last week I changed it in the WP settings to be namelymarly.com.

WP created the new htaccess file, and I moved the index.php to the root directory (but left the WP folder where it was in the /blog/ directory), as instructed. Everything is working great except for one very important thing:

When you type 'namelymarly.com/blog/' into a browser now, you get a 404 error.

All other URLs, when they include the '/blog/somethinghere', will redirect properly to '/somethinghere.' It's only when there's nothing after '/blog/' that there's a problem.

I tried adding this rule but it still redirects to the 404 page:

开发者_运维问答

RewriteRule ^/blog/$ /index.php

Any suggestions/help?


install "Redirection" and then add a 301 redirect from namelymarly.com/blog/ to namelymarly.com


Did you follow these diections?: Moving WordPress « WordPress Codex

You don't need the redirection plugin. Wordpress handles redirects if you regenerate permaliks. If you have to, use this in .htaccess before the Wordpress rewrite block:

Redirect 301 /blog http://namelymarly.com

But first, be sure you've reset your permalinks in Dashboard/Settings/Permalinks and make sure that copy the changes to .htaccess yourself and that there is only the most recent - the last - rewrite block in the file (WP has a habit of adding more and more rewrite blocks to .htaccess).

And check the URLs of your other URLs in the post/page editor and see if they contain /blog/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜