url rewriting - subdirectory install breaking existing links

I've had this issue several times now. While building a site, including some content, I keep WordPress in a subdire

I've had this issue several times now. While building a site, including some content, I keep WordPress in a subdirectory (say, /wordpress/). When putting it live, I move/copy 3 files out of the dir into the root, in accordance with the WordPress specifications here:

It works, but all the links already entered in content refer to /wordpress/bla/bla and will, after the move, return 'file not found'. Also, links previously sent in emails and links already indexed by Google will return file not found.

My question: Is this behaviour as designed, or am I doing something wrong?

Please note: My question is not how to fix it. It's easy enough to add some lines to the root .htaccess to say, "for every request inside /wordpress/, if it doesn't exist, remove the word /wordpress/ and try again," so I'm surprised WordPress doesn't do that by itself. This makes me think I'm doing something wrong.

I've had this issue several times now. While building a site, including some content, I keep WordPress in a subdirectory (say, /wordpress/). When putting it live, I move/copy 3 files out of the dir into the root, in accordance with the WordPress specifications here: http://codex.wordpress/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

It works, but all the links already entered in content refer to /wordpress/bla/bla and will, after the move, return 'file not found'. Also, links previously sent in emails and links already indexed by Google will return file not found.

My question: Is this behaviour as designed, or am I doing something wrong?

Please note: My question is not how to fix it. It's easy enough to add some lines to the root .htaccess to say, "for every request inside /wordpress/, if it doesn't exist, remove the word /wordpress/ and try again," so I'm surprised WordPress doesn't do that by itself. This makes me think I'm doing something wrong.

Share Improve this question edited Jan 25, 2020 at 21:06 feetwet 1712 silver badges17 bronze badges asked Feb 8, 2013 at 17:15 commonpikecommonpike 1351 silver badge8 bronze badges 1
  • There is really cool plugin you can use - Velvet Blues. It will change old links to new ones. – Fresz Commented Jan 25, 2020 at 23:02
Add a comment  | 

2 Answers 2

Reset to default 1

You're not doing anything wrong. WordPress does not monitor the links within content, so it's up to you to change them when your structure changes.

In the past, we used a "Search and Replace" plug-in for WordPress to mass change the content of a site that was moved to a new hosting server.

Not sure if this plug-in will work for you, but you can give it a try:

http://wordpress/extend/plugins/search-and-replace/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744804507a4594690.html

相关推荐

  • url rewriting - subdirectory install breaking existing links

    I've had this issue several times now. While building a site, including some content, I keep WordPress in a subdire

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信