Redirect HTTP request to HTTPS request

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]

Too many redirects error when change of base url

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

wp_redirect leading to an infinite loop

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

How to make a redirect link in wordpress?

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]

How to redirect non-admin/editors from specific pages?

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