How to Block WordPress from subdomain?
Just use a RedirectMatch 404 in your WordPress .htaccess: RedirectMatch 404 ^/(sub-folder-1|sub-folder-2)(/.+)?$
Just use a RedirectMatch 404 in your WordPress .htaccess: RedirectMatch 404 ^/(sub-folder-1|sub-folder-2)(/.+)?$
Blog post URL redirects to a Page URL who’s slug is a prefix of the post slug.
I wrote function for short url. Maybe it will be helpful for someone: function short_url(){ global $post; if (preg_match(‘/^http:\/\/example.com\/page\/[0-9]{1,4}$/’, “http://”.$_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”])) { $my_id = intval(preg_replace(‘/[^0-9]+/’, ”, $_SERVER[“REQUEST_URI”]), 10); global $wpdb; $myquery = $wpdb->get_row($wpdb->prepare(“SELECT * FROM wp_mytable WHERE ID=%d”, $my_id)); $short_url=”http://example.com/?page_id=”.$myquery->page_id.”&user_id=”.$myqery->user_id; wp_redirect($short_url); exit(); } } add_action( ‘template_redirect’, ‘short_url’ );
I think I found the solution myself. When I adjusted the declaration of the registration form: <form name=”registerform” id=”registerform” action=”<?php echo esc_url( site_url(‘wp-login.php?action=register’, ‘login_post’) ); ?>” method=”post” novalidate=”novalidate”> To the following: <form name=”registerform” id=”registerform” action=”<?php echo esc_url( site_url(‘wp-login.php?action=register&role=”.$_GET[“role’], ‘login_post’) ); ?>” method=”post” novalidate=”novalidate”> Then my problem is solved and the registration page is not redirected … Read more
Why you want to store this type of slug.If you store this type of slug and after some time when you edit any item from wordpress back-end,then it will update with its own slug.Better way is to store your slug as wordpress store itself..
How to block direct access to files upload in edd folder
Check your wp-config as well as your blog domain inside the wp_options table to see what domains are listed. The domains may be referencing the original domains. You may also have to resave your permalinks depending on the changes you made. There is some additional materials in the codex to help you narrow it down: … Read more
You need to be sure that you have noted global $noCookiesLeft; before setting it in the if statement. It may be unset when it runs the no_cookie() function.
The wp_logout() function is pluggable. You should be able to write your own version and “overload” the Core function: function wp_logout() { $lid = get_current_user_id(); wp_destroy_current_session(); wp_clear_auth_cookie(); do_action( ‘wp_logout’ ); /** * Fires after a user is logged-out. * * @since 1.5.0 */ if (2 == $lid) { wp_redirect(home_url(“/redirectTo”)); exit; } }
Use wp_redirect() function instead of header(). Here is the code example: wp_redirect($redirect);