Nginx Wildcard SSL with WordPress Multisite Subdomains

You can use regular expressions in the server_name directive, but wildcard names (e.g. *.example.com) take precedence. See this document for details. For example: server { listen [::]:80 ipv6only=off; server_name ~^(www\.)?(?<name>(.+\.)?example\.com)$; return 301 https://$name$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; include snippets/ssl-example.com.conf; include snippets/ssl-params.conf; server_name ~^www\.(?<name>(.+\.)?example\.com)$; return 301 https://$name$request_uri; } server { listen … Read more

How do I flush rewrite rules

I haven’t worked much with flush_rewrite_rules function, but based on the usage notes mention by nmr I think you could perhaps do something like this, add_action( ‘save_post’, ‘my_save_post_function’ ); function my_save_post_function( $post_id ) { $maybe_some_extra_logic = true; // if applicable if ( $maybe_some_extra_logic && ! has_action( ‘shutdown’, ‘my_flush_rewrite_rules’ ) ) { add_action( ‘shutdown’, ‘my_flush_rewrite_rules’, 9999 … Read more

Redirections and rewrites to subdomain

Redirect 301 /privacy-statement https://example.com/privacy/ You should avoid using a mod_alias Redirect directive when you are already using mod_rewrite for other redirects. mod_alias runs after mod_rewrite, regardless of the apparent order of the directives in your .htaccess file, so it’s possible to get unexpected conflicts. This should be converted to a mod_rewrite (RewriteRule) redirect instead: RewriteRule … Read more

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