Forum Moderators: phranque
# If widget/ URL-path requested from non-example-B.com host, rewrite to non-existent filepath to force 404 response
RewriteCond %{HTTP_HOST} !^example-B\.com
RewriteRule ^widget/ /filepath-which-is-known-not-to-exist.lmth [L]
# If widget/ URL-path requested from non-example-B.com host, force 404 response
RewriteCond %{HTTP_HOST} !^example-B\.com
RewriteRule ^widget/ - [R=404,L]
RewriteCond %{HTTP_HOST} !^example-B\.com
RewriteRule ^widget/ /filepath-which-is-known-not-to-exist.lmth [L] /filepath-which-is-known-not-to-exist.lmth" bit. Leave it EXACTLY as it is.
RewriteEngine on
#
# Force 404 on all blog requests, except for example-B/blog/
RewriteCond %{HTTP_HOST} !^example-B\.com
RewriteRule ^blog/ /filepath-which-is-known-not-to-exist.lmth [L]
#
# Begin WordPress rewrite (modified)
# Rewrite all non-blank requested URL-paths which do not resolve to physically-existing files to the WP
# script, except for image, css, and js files not generated by WP, and requests for the WP script itself.
# These exclusions greatly improve efficiency, and can often forestall a required server upgrade.
RewriteCond %{HTTP_HOST} ^example-B\.com
RewriteCond $1 !^blog/index\.php$
RewriteCond $1 !\.(gif|jpe?g|png|ico|css|js)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/(.+)$ /blog/index.php [L]
# END WordPress