This file contains hidden or 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
# Attempt to load files from production if they're not in our local version (replace {SITE URL} with your production server) | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://{SITE URL}/$1 [QSA,L] | |
</IfModule> |
This file contains hidden or 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
<?php | |
/** | |
* Class LocalValetDriver | |
* | |
* This class demonstrates how we might go about proxying any missing local images to a remote host. i.e; the production | |
* site. This has been created with WordPress in mind but could be adjusted to work with any other system. | |
*/ | |
class LocalValetDriver extends WordPressValetDriver { |
This file contains hidden or 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
# PROTECT WORDPRESS FOLDERS AND CONTENTS. | |
RewriteCond %{REQUEST_URI} /wp-admin/ | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteCond %{REQUEST_URI} \.php$ [NC] | |
RewriteCond %{REQUEST_URI} !/wp-admin/(load-styles|admin-ajax)\.php$ | |
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_.+ | |
RewriteRule .* - [G,L] | |
RewriteCond %{REQUEST_URI} /wp-includes/ | |
RewriteCond %{REQUEST_FILENAME} -f |