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目录中。丢失上传的请求将被重定向到的主要内容,如果未能解决你的问题,请参考以下文章