apache_conf 将其添加/重命名为.htaccess并将其放在WordPress wp-content / uploads目录中。丢失上传的请求将被重定向到

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 将其添加/重命名为.htaccess并将其放在WordPress wp-content / uploads目录中。丢失上传的请求将被重定向到相关的知识,希望对你有一定的参考价值。

#!/bin/bash

## Redirect Requests for Missing Uploads
#
# Place this .htaccess file in the WordPress wp-content/uploads directory.
# Any request for a missing file will be redirected to the reference environment
# listed in the active RewriteRule.
#
# Useful during post-launch development for any environment that does not have a
# complete copy of wp-content/uploads.
##
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) https://www.example.com/wp-content/uploads/$1
# RewriteRule (.*) https://live-example.pantheonsite.io/wp-content/uploads$1
# RewriteRule (.*) https://test-example.pantheonsite.io/wp-content/uploads$1
# RewriteRule (.*) https://dev-example.pantheonsite.io/wp-content/uploads$1
</IfModule>

以上是关于apache_conf 将其添加/重命名为.htaccess并将其放在WordPress wp-content / uploads目录中。丢失上传的请求将被重定向到的主要内容,如果未能解决你的问题,请参考以下文章

将 WebP 重命名为 JPG 或其他格式的缺点?

os.rename 在重命名为带有 utf 字符的内容时添加了一个额外的字符

防病毒误报?

在git中将文件批量重命名为小写

使用 Java 重命名文件

客户端攻击(溯源攻击,获取客户端信息)