WordPress破碎的图像

时间:2017-06-05 21:07:35

标签: wordpress .htaccess url

我不知道是什么原因导致这个问题,但迁移到新服务器后我的WordPress网站没有显示我的图像。它可能是.htaccess文件中的内容,重写规则或其他内容。有任何指示吗?

请点击here查看我的信息页。 来自.htaccess目录的public_html

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
来自wp-content / uploads的

.htaccess文件:

# BEGIN alti-watermark Plugin
<ifModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^(.*(-([1-3][\d]{1,2}|[\d]{1,2})x300|-300x([1-3][\d]{1,2}|[\d]{1,2})|-([1-1][\d]{1,3}|[\d]{1,3})x1024|-1024x([1-1][\d]{1,3}|[\d]{1,3})|-940x446)\.jpg|.*(?<!-\dx\d)(?<!-\d\dx\d)(?<!-\dx\d\d)(?<!-\d\dx\d\d)(?<!-\d\d\dx\d\d)(?<!-\d\dx\d\d\d)(?<!-\d\d\dx\d\d\d)(?<!-\d\d\d\dx\d\d\d)(?<!-\d\d\d\dx\d\d)(?<!-\d\d\dx\d\d\d\d)(?<!-\d\d\d\dx\d\d\d\d)(?<!-\d\d\d\dx\d\d\d)(?<!-\d\d\d\dx\d\d)(?<!-\d\d\d\d\dx\d\d\d\d\d)\.jpg){1}((\?|\&)([^\.\?\ ]+))*$ ../plugins/alti-watermark/public/views/alti-watermark-public-bridge.php?imageRequested=$1 [PT]
</ifModule>
# [date=2016-12-27 18:06.57] [php=5.4.45] [width=300x300|1024x1024|940x446|fullsize] [plugin_name=alti-watermark] [version=0.3]
# END alti-watermark Plugin

提前致谢!

1 个答案:

答案 0 :(得分:1)

通常这是因为文件路径在数据库中保存为绝对路径。

在这种情况下,您需要获取一些插件来更改所有这些文件路径(请参阅https://wordpress.org/plugins/search/migration/获取资源)或将数据库导出为mysql文件,在编辑器中打开并执行搜索/替换用新文件路径实例替换所有旧文件路径实例,然后再在数据库中导入它。