Drawbacks to using Options -Indexes

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

403 error on admin login page

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

How can I enable keep alive (Not accessing to Apache)

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);

WordPress not seeing .htaccess rules

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

301 Redirect domain Sub-folders to Subdomain subfolder

If both the main domain and subdomain point to the same directory on the filesystem, then you need to check the requested host using a mod_rewrite condition. So, for example, the following directives should go before the WordPress front-controller (ie. before the # BEGIN WordPress section): RewriteCond %{HTTP_HOST} ^(example\.com) [NC] RewriteRule ^(music/end/)$ http://music.%1/$1 [R=301,L] The … Read more

WP install in sub-dir white screen

If WordPress is installed in the directory /dir1/dir2 and the corresponding .htaccess file is also in that subdirectory, ie. /dir1/dir2/.htaccess, then the .htaccess file should look something like: # 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 … Read more