Created
December 31, 2022 17:48
-
-
Save fsgreco/037f4df9fb36732dff8a0ac358524c8a to your computer and use it in GitHub Desktop.
Htaccess for WordPress local development - it let you visualize upload files (from production) in your localhost environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT © Santiago Greco - fsgreco@hey.com | |
# | |
# What it does: | |
# If the site is already in production, instead of manually download all the files in upload folder | |
# your local apache server will search and use the production files if they are not found on localhost | |
# | |
# How to use it: | |
# Place this file inside your own localhost environment: `your_localhost/wp-content/uploads/.htaccess` | |
# Change "YOUR_DOMAIN.TLD" with your actual production domain name inside the RewriteRule line. | |
# | |
# For more context and information please consult the documentation of the entire project: | |
# docker-wordpress - https://github.com/fsgreco/docker-wordpress#how-to-use-it | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Change YOUR_DOMAIN.TLD with your actual production domain | |
RewriteRule (.*) https://www.YOUR_DOMAIN.TLD/wp/wp-content/uploads/$1 | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment