Non-existent URLs/slugs redirect to default Posts page
Non-existent URLs/slugs redirect to default Posts page
Non-existent URLs/slugs redirect to default Posts page
One page is redirected to home and I don’t understand why
One of the ways to do this is by using mod_rewrite. Open your .htaccess file and add this code before the # BEGIN WordPress line: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^aritcles/(.*)$ /$1 [R=301,NC,L] RewriteRule ^news/(.*)$ /$1 [R=301,NC,L] RewriteRule ^reviews/(.*)$ /$1 [R=301,NC,L] </IfModule>
WordPress Redirects Old Post Url to New Related Post
I had the exact same problem, and I believe that was probably caused because WordPress doesn’t know about the primary category (that is something added by Yoast SEO instead). So is something that in my opinion Yoast SEO should manage, hopefully in next releases they’ll do it. In the meanwhile it looks I’ve smoothly resolved … Read more
You can do it with the “template_redirect” hook. For multisite or simple WordPress. e.g: add_action(‘template_redirect’, function(){ $user = wp_get_current_user(); $userRoles = $user->roles; $url = site_url(); if(!in_array(‘administrator’, $userRoles) && !is_front_page()){ wp_redirect($url); exit; } }); EDIT is_front_page() will work only if “Front page displays” is set. Use is_home() if not. EDIT #2 Accordind with our discuss below, … Read more
Recommend using htaccess to take care of SSL redirects as needed. Will prevent ‘mixed content’ errors. I don’t think WP does any redirects, other than to get the content. If your settings have non-SSL, that’s what people will get. Using htaccess will prevent problems.
How to redirect non admin user after login
You can remove the trailing slash from the pagination links by adding untrailingslashit() function as callback for paginate_links filter. Put this code in your theme’s functions.php or in an mu-plugin (untested): add_filter( ‘paginate_links’, ‘untrailingslashit’ );
If your server or WordPress install has page caching, confirm if the login page is being cached. This would explain why the hidden field is not updating with the query parameter. Reviewing wp-login.php, looks like if the user does not have the read capability, that they’ll be redirected to the home URL. Double-check that the … Read more