我刚刚从 Drupal + Wordpress 迁移到完全用 WordPress 构建的网站。
我有一组图像,其中文件不再存在,需要尝试将所有图像保留在一个文件夹中(如果可能)。我需要发送对任何 gif|png|jpg 的请求http://www.domain.com/blog/wp-content/uploads/ http://www.domain.com/blog/wp-content/uploads/ to http://www.domain.com/wp-content/uploads http://www.domain.com/wp-content/uploads.
如果有人可以提供帮助,我们将不胜感激 - 我的 .htaccess 不再是以前的样子了。提前致谢
如果你用谷歌搜索“htaccess重定向”,最上面的链接是这样的:
http://www.htaccessredirect.net/ http://www.htaccessredirect.net/
如果您使用“301重定向目录”部分,您会得到以下代码:
//301 Redirect Entire Directory
RedirectMatch 301 /blog/wp-content/uploads/(.*) /wp-content/uploads/$1
据我所知,目标域应该是绝对的,因此以下方法可能有效:
//301 Redirect Entire Directory
RedirectMatch 301 /blog/wp-content/uploads/(.*) http://www.domain.com/wp-content/uploads/$1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)