In File Explorer, go to C:\MAMP\conf\apache
and open httpd.conf
with your text editor.
Find this line:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# Pull Image Files From Live Server | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^(.*\.(png|jpe?g|gif|ico|svg)) https://production-site.com//$1 [NC,L] | |
RewriteRule ^index\.php$ - [L] |
<?php | |
/** | |
* Example useage: | |
* | |
* maybe_sideload_image( 'https://dummyimage.com/600x400/000/fff.png' ); // Downloads image to the media library and returns an attachment ID | |
* maybe_sideload_image( 'https://dummyimage.com/600x400/000/fff.png' ); // Returns an attachment ID as the image has already been downloaded and added to the media library | |
*/ | |
/** |