wp_redirect() not redirecting user to supplied URL
wp_redirect() not redirecting user to supplied URL
wp_redirect() not redirecting user to supplied URL
Although the answer in the comment to your question will work (here it is formatted), there are some variations that might be needed depending on your hosting environment, so contact your hosting support for specifics. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Have you tried defining WP_SITEURL and WP_HOME to point to the correct URL? This “overrides” the DB settings. https://codex.wordpress.org/Editing_wp-config.php#WP_SITEURL If that doesn’t work, the next thing to try is the RELOCATE method https://codex.wordpress.org/Changing_The_Site_URL#Relocate_method
You have to use the registration_redirect hook, add this into your theme’s functions.php function wpse_registration_redirect() { return home_url( ‘/page’ ); } add_filter( ‘registration_redirect’, ‘wpse_registration_redirect’ );
You’ve got most of it right. However, there is one little caveat: $url doesn’t mean anything in your context. You can easily prove that by using something like this for debugging add_action(‘template_redirect’, ‘post_redirect_by_custom_filters’); function post_redirect_by_custom_filters() { var_dump($url); wp_die(); } So all that is left for your code to work is actually defining $url as the … Read more
You can add that redirection to your functions.php, you have to use the registration_redirect hook: function wpse_registration_redirect() { return home_url( ‘/page’ ); } add_filter( ‘registration_redirect’, ‘wpse_registration_redirect’ );
Login redirects to home page and doesn’t log in
Check out 301 redirect plugin https://wordpress.org/plugins/simple-301-redirects/ OR Add redirect rule in to .htaccess file RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC] RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Uh Oh. You are using absolutely useless method. Posts, categories(and everything in WP) can be freely accessed via different kind of url combinations,feeds,api and etc (so forget your code/htaccess method). Instead, use php codes in your active theme’s functions.php: if (is_category() ) { global $cat; if ($cat->term_id = 123) { if (!current_user_can(‘install_plugins’)) { } } … Read more
I’d do it even simpler. Most hosting places allow you to specify where the root folder of your domain is. Just change that location, and the new WP site is available. You shouldn’t need to change anything; use the standard WP htaccess, and leave the wp-config.php settings alone. I use a standard procedure of my … Read more