Serve apache 404 for missing assets rather then wp 404 template WP_Rewrites

This very helpful page is unfortunately kind of burried on the codex: Basically mod_rewrite_rules hook will do the trick. function faster_htaccess_rules( $rules ){ $faster_rules = <<<EOD \n # BEGIN faster Apache 404 rules RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(jpg|jpeg|png|gif|ico|swf|bmp)$ – [R=404,L] #Use instead for network sites #RewriteRule \.(jpg|jpeg|png|gif|ico|swf|bmp)$ – [nocase,redirect=404,last] # END faster Apache … Read more

Globally force SSL on all pages

To globally redirect all your pages to HTTPS add the following lines to your .htaccess: # Globally force SSL. RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This should be placed directly after RewriteEngine on if you have no previous rewrites.

Why “Settings->Permalinks” creates .htaccess file on nginx server?

WordPress tries to detect the webserver’s type by peeking into the global $_SERVER[‘SERVER_SOFTWARE’] variable. The Apache check is: $is_apache = (strpos($_SERVER[‘SERVER_SOFTWARE’], ‘Apache’) !== false || strpos($_SERVER[‘SERVER_SOFTWARE’], ‘LiteSpeed’) !== false); and the Nginx check is: $is_nginx = (strpos($_SERVER[‘SERVER_SOFTWARE’], ‘nginx’) !== false); You should therefore first check out: var_dump( $_SERVER[‘SERVER_SOFTWARE’] ); to see if it’s correct. Here … Read more

htaccess rewrite for author query string when WP is in subfolder

The question is about doing this with .htaccess, but why not disabling author pages from within WordPress instead? This would achieve the same result while making the subdirectory concern irrelevant altogether (and also works regardless of permalink structure settings) Sample code that sets all urls to author pages to a 404 error: add_action( ‘template_redirect’, function() … Read more

Plugin to edit htaccess file

Here are a couple of options: WP htaccess Control – will let you manually edit your .htaccess file All-in-one htaccess Plugin – will let you dynamically create an .htaccess file based on which modules/features you want set up When all else fails, turn to Google …

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)