Code to create a redirection after login?

You can use the login_redirect hook. function redirect_admin( $redirect_to, $request, $user ){ //is there a user to check? if ( isset( $user->roles ) && is_array( $user->roles ) ) { //check for admins if ( in_array( ‘administrator’, $user->roles ) ) { $redirect_to = WP_HOME.’/quote-list/’; // Your redirect URL } } return $redirect_to; } add_filter( ‘login_redirect’, ‘redirect_admin’, … Read more

htaccess 301 redirect http to https doesn’t work

You’ve put the redirect code in the wrong place. It needs to go before the # BEGIN WordPress section. By placing the redirect code after the WordPress front-controller it will never be processed unless the request is for a physical file. However, your first attempt is not correct (it’s missing the check for HTTPS), so … Read more

Deny access to a path (give 403 or 404 response)

# this give internal server error throughout site: <Files ~ “/users/”> Header set X-Robots-Tag “noindex, nofollow” </FilesMatch> This would give an “internal server error” (500 response) because you’ve used </FilesMatch> to close the <Files> section. It should be </Files>. But as you suggested, this won’t work anyway, as the <Files> directive matches real files only, … Read more

How do I map a subdomain in wordpress to the primary domain in a multisite setup?

Do you have to have secure.domain.com function or can it redirect? The tl;dr is that you don’t. The primary domain is the cheese: it stands alone. However…. You can use .htaccess to check ‘If someone is coming from secure.domain.com, send them to domain.com’ RewriteCond %{HTTP_HOST} ^secure\.domain\.com RewriteRule ^(.*) http://domain.com/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^www\.domain\.com RewriteRule ^(.*) … Read more