WordPress 404 on Subdomain

You don’t appear to have allowed .htaccess overrides in the <VirtualHost *:443> container, so .htaccess is effectively disabled. Without .htaccess you’ll naturally get 404s for anything other than the homepage if you are using “pretty” permalinks. (.htaccess is not required for requests to the homepage, since index.php is served by mod_dir which is no doubt … Read more

Best way to redirect site in subdirectory to root?

The only way I managed to get this to work was with the following in the .htaccess of the /site/ directory: RewriteBase \ RedirectMatch 301 ^/site/$ /$1 RedirectMatch 301 ^/site/(?!wp-admin/|wp-content/|wp-includes/)(.*)$ /$1 Whilst I am aware that RewriteRule ^site/ /$1 [R=301,NC,L] should have worked, and that RewriteRule ^site/(.*)$ /$1 [R=301,NC,L] should have also worked (according to … Read more

WordPress On subfolder

Maybe try something like this.. .htaccess on your root: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress .htaccess inside your /wordpress/ directory: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond … Read more

Allow logged in users who doesn’t belong to whitelisted ips

Simple & Fast but not 100% secure method: This method is not 100% secure, but for most users (like 99%), it’ll work. Here, basically you’ll use a .htaccess file inside the restricted directory, say: /var/www/html/link with the following CODE: SetEnvIf Cookie “^.*wordpress_logged_in.*$” WP_LOGGED_IN=maybe Order allow,deny Require all granted # Our Network #Allow from ip-address/22 #Allow … Read more

Site searches by Python for non-existent assets

What are the python searches? Are they like bad bots? Most probably just “bad bots” searching for potential vulnerabilities. How do I block or prevent them? Well, you are already serving a 404 by the sounds of it, so it’s really a non-issue. However, you can prevent the request from going through WordPress by blocking … Read more

Question with loading 403/ 404 error pages and htaccess

it create a never-ending loop as WordPress tries to find the 403.php page Not WordPress, but Apache. WordPress never even sees the request. You need to make an exception for your custom 403 error document, otherwise, the directives you have posted would issue another 403 for the error document itself… an endless loop. If your … Read more