Htaccess Rewrite reverts to default .htaccess file
manual modifications of .htaccess must be done after “# END WordPress” to not be overwrited
manual modifications of .htaccess must be done after “# END WordPress” to not be overwrited
The RewriteEngine On line (as you have indicated) isn’t necessary, and pertains to a different module, mod_rewrite. You should remove it from the mod_headers block. It’s possible that you don’t have the Headers Apache module installed or activated on your host. If it is possible to run the test with some breakage, you could try … Read more
This is a pointless question. you either do a sitewide HTTPS or just don’t do it at all. Doing HTTPS for only some pages is just lying to yourself about the security of the site. You can decide to have HTTPS for only some of your users, but you can never do it just on … Read more
As far as I can see, it is not possible to use a custom 404 ErrorDocument directive in your htaccess file because WordPress’ index.php will always be found when processing the htaccess content. (unless ofcourse index.php got deleted for some reason) Because index.php is found, it will not trigger the ‘404 not found’ ErrorDocument directive. … Read more
Managed to figure it out and want to share it with others in case they’re having the same issue. When protecting wp-admin, protect it using wp-admin/.htaccess file, but that only works for the wp-admin directory, and won’t affect the wp-login.php file which is outside that directory. Add protection to the wp-login.php file using the <files></files> … Read more
As I’m running my WordPress on Nginx, so I can’t help on the .htaccess one. But I can comment on the padlock issues. There are a few things need to be done at WordPress: Login into WordPress Admin Dashboard, and go to WordPress Settings and change the WordPress Address (URL) and the Site Address (URL) … Read more
There are some legitimate use cases for enabling Indexes but they’re probably not applicable to most sites (especially WordPress sites). For example Indexes are helpful on file storage mirrors where you want to provide readonly access to a subset of folders & files without having to build your own UI. As a best practice, yes, … Read more
I managed to enter the admin page finally! So I added these two lines to wp_admin.php: define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); afterward deleted the .htaccess file, then deleted browsing history, cleared cache and cookies. After all of this I could enter the admin page. Then I went to options/general and options/permalinks and saved the setting, it generated a … Read more
Check out wp_headers filter: /** * Filter WordPress headers before sent * * @see https://developer.wordpress.org/reference/hooks/wp_headers/ */ function wpse_289493($headers, $wp) { foreach ($headers as $key => $value) { if (‘connection’ === strtolower($key)) { unset($headers[$key]); } } $headers[‘Connection’] = ‘Keep-Alive’; return $headers; } // Add filter add_filter(‘wp_headers’, ‘wpse_289493’, 10, 2);
apache “AllowOverride” was set “None” but changing it to “All” made no effect : I changed the “AllowOverride” in the “apache2.conf” file. It’s still not clear where exactly you are setting AllowOverride. This directive can only be used in a directory context. ie. Inside a <Directory> container in your main server or VirtualHost config. You … Read more