Hello,
I have a site where I enabled apache basic authentication before before the acutal WP login page, this is done through .htaccess file directives. I’ve provided a link to a How to page, so you can better understand what I’ve implemented and it works, however it works in an erea where I don’t want it to work, i.e. affecting the inputs of search. You are welcome to see the issue by going to https://healthstoday.com and at the top right of the header you’ll see the ‘magnifying glass’ click to search and then attempt type in a search term, say, “exercise” the second you input an ‘ex…’ or any character the Apache Login modal window appears. That is only suppose to appear and it does when users attempt to hit the WordPress login page, https://healthstoday.com/wp-admin. Now, I don’t think the issue is a tagDiv or even WordPress issue, I suspect the issue is in the path locations pointing to key sections and files, thus my request for support because I would like to know a few things about the Newspaper theme.
The site is updated with regards to apache, PHP, and db, the Newspaper theme is installed and is one minor version behind.
I would like to know the path to the magnifying glass / search code to update the .htaccess files path.
What solution(s) do you think I should try?
I’m little weak in the WP area but is it a component, widget, block? (Reply if relevant if not no worries)?
Here is the wordpress-https-vhost.conf file for your review.
<VirtualHost 127.0.0.1:443 _default_:443>
ServerName http://www.healthstoday.com
ServerAlias *
SSLEngine on
SSLCertificateFile “/path/to/apache/conf/bitnami/ssl/certificate.crt”
SSLCertificateChainFile “/path/to/apache/conf/bitnami/ssl/ca_bundle.crt”
SSLCertificateKeyFile “/path/to/bitnami/ssl/private/private.key”
DocumentRoot /path/to/wordpress
<Directory “/path/to/wordpress”>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Require all granted
RewriteEngine On
RewriteRule ^relative-path/to/wordpress(/.*) $1 [L]
# END WordPress fix for plugins and themes
# BEGIN WordPress
# https://wordpress.org/support/article/htaccess/#basic-wp
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</Directory>
Include “/path/to/apache/conf/vhosts/htaccess/wordpress-htaccess.conf”
<LocationMatch “^/(wp-admin|wp-login\.php)”>
AuthType Basic
AuthName “Private access”
AuthUserFile “/path/to/apache/.htpasswd”
Require valid-user
</LocationMatch>
# FOLLOWING THREE LINES DID NOT WORK
# <Location “/wp-admin/search.php”>
# Allow from all
# </Location>
# IS THE FOLLOWING LINE CORRECT OR SHOULD THE PATH BE DIFFERENT
<Location “/path/to/wordpress/wp-content/plugins/td-standard-pack/Newspaper/search.php”>
Allow from all
</Location>
# FOLLOWING 3 LINES WORK
<FilesMatch “^license\.txt$”>
Require all denied
</FilesMatch>
</VirtualHost>
Please help me tagDiv your my only hope. đ
Regards,
Joey
Hi,
It looks that this extra security is locking the theme admin-ajax request – https://i.imgur.com/Zs3LaiB.png I think that this problem can be resolved by excluding that path from from applying the protection code.
I hope this will help you!
Hi Calin,
Thank you for taking the time to reply, I think you may have found the solution, unfortunately even though I tried to make the update other pressing responsibilities kept me away from following through on your recommendation, I know I will have / make time for it tomorrow. I wanted to quickly reach and say thank you for looking into this. I will reply tomorrow to let you know how it went. Thank you.
Regards,
Joey
Hi,
I think it can be use something like this – https://gist.github.com/vielhuber/6e755cdeeaf14f3abbbaebc7d5308b78
On the line “SetEnvIf Request_URI “^/wp-json/” allow_path” you can replace it with the one that appears in console.
I hope this will help a bit!
Hell Calin,
After many many attempts to get it to work, I was finally successful. Your advice and tips from both replies helped and I don’t think I could have done it without you. THANK YOU VERY MUCH. I wish you the best. FYI, I will be buying another license of tagDiv Newspaper, I’m very happy with your product and especially the service. 10 out of 10.
Regards,
Joey