How to watermark wordpress images from wp-content/uploads folder with htaccess and php?

The rewrite condition !-f means “if file does not exist”. Since the files exist, the rule is never reached. Just changing the order should fix the problem. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^wp-content/uploads/(.*\.(jpe?g|gif|png))$ watermark.php?p=br&q=90&src=wp-content/uploads/$1 [L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

ouput buffering confusing me!

the_content(), output of which you are filtering, is a template tag. It’s meant to be used as part of HTML page. One page load cannot simultaneously be HTML page and PDF download. File download you are generating needs to happen before HTML template is loaded, for example on template_redirect hook and exit after so that … Read more

Local domain remap with proxy : Infinite 301 redirect, bad URL typo

Found the problem / the solution: while using the proxy, the servers variable REQUEST_URI is not the same using FoxyProxy, server var ‘REQUEST_URI’ return the full url: $_SERVER[‘REQUEST_URI’] -> “hxxp://mydomain.com/theurl” using windows host file, server var ‘REQUEST_URI’ return just the end of the url: $_SERVER[‘REQUEST_URI’] -> “/theurl” so I added this to the wordpress index.php … Read more

Redefine REST API variables

So there are two moving parts at work: Domain which web server maps to WP installation Domain WP installation thinks it’s installed on Under normal circumstances these simply match. In your case you have two domains mapped to the installation. WP can only think about one domain at a time. At a time is important … Read more