admin管理员组文章数量:1134549
Yesterday I moved my sites from to (secure site and removed the www). Now when I look at an attachment page I see the File URL as the old http://www ... but the page permalink at https://.
I have even deleted the original photos and re-uploaded new ones, thinking that might solve it, but it does not. The domain is properly set (https://) in Wordpress Settings/General. The site works fine ... and the switch to https went much more smoothly than I had anticipated ... except for this issue.
Has anyone encountered similar? Or know what/where I need to change something?
Thank you for any info/advice.
Yesterday I moved my sites from http://www.example.com to (secure site and removed the www). Now when I look at an attachment page I see the File URL as the old http://www ... but the page permalink at https://.
I have even deleted the original photos and re-uploaded new ones, thinking that might solve it, but it does not. The domain is properly set (https://) in Wordpress Settings/General. The site works fine ... and the switch to https went much more smoothly than I had anticipated ... except for this issue.
Has anyone encountered similar? Or know what/where I need to change something?
Thank you for any info/advice.
Share Improve this question asked Feb 8, 2016 at 4:41 drrileydrriley 11 bronze badge 1- How have you done the change? Have you followed the instructions for changing the URL of a WordPress site? – cybmeta Commented Feb 8, 2016 at 13:40
1 Answer
Reset to default 0I think a possible solution could be following codesnippet from Mark Kaplun.
To solve issues with this you could remove the http
part and Wordpress will/should use https
instead.
Because the rest of your website is working correctly I assume that further settings are correct and will do their job as wished.
add_filter('the_content','wpse_217012',1000,1);
// remove 'http:' part from any mention of the site url
function wpse_217012($content) {
return str_replace(siteurl(),str_replace('http:','',siteurl()),$content);
}
Please add the snippet to functions.php
(make a copy first) or to a plugin
.
Note: Of course is this a solution to achieve a positive result and actually not pointing on the cause of your problem as it. I personally would not use a
redirect
done by code in.htaccess
because, as mentioned by yourself already, the rest is working.
Maybe there is aplugin
or own code somewhere infunctions.php
which is causing the problem? Please take also a look at these possibilities.
If I am totally wrong, please let me know and I will remove the answer to prevent other users here on wpse will use the (incorrect)code for an equal problem.
本文标签: WP media attachment location vs permalink
版权声明:本文标题:WP media attachment location vs permalink 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736859227a1955841.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论