Disabling HTTPS redirection for migration

In the active theme I found the redirection in header.php Once commented out the issue was resolved. if($_SERVER[“HTTPS”] != “on”) { header(“Location: https://” . $_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”]); exit(); }

Redirect all pages to homepage but still allow dashboard

Just use ‘ template_redirect ‘ hook This action hook executes just before WordPress determines which template page to load. It is a good hook to use if you need to do a redirect with full knowledge of the content that has been queried. add_action(‘template_redirect’,’redirect_all_pages_to_home’); function redirect_all_pages_to_home() { if ( ! is_front_page() ) { wp_redirect( get_home_url() … Read more

https multiple redirects

This is somewhat of a guess, but it is probably a result of the web server configuration. What your server probably does is to see that the request want to load the blog url of the site. It checks out and sees that blog is a directory adds a slash and redirects to it. Now … Read more

How to remove “YEAR/MONTH/” from uploads URL & redirect old URL to the new form?

The .htaccess RewriteRule to rewrite only .pdf to not use /year/month/ can look like this RewriteRule ^wp-content/uploads/([0-9]+)/([0-9]+)/(.+?)$ /wp-content/uploads/$3.pdf [L,R=301] You should add this prior to WordPress’ rules, so it will be evaluated before them, resulting in a .htaccess file like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^wp-content/uploads/([0-9]+)/([0-9]+)/(.+?)\.pdf$ /wp-content/uploads/$3.pdf [L,R=301] </IfModule> # BEGIN WordPress … Read more

Cant Access Website – Changed HTTP to HTTPs

By default web servers / your hosting serves files from HTTPS from a separate folder. This means that there are actually two directories on the server for hosting your website files: For example public_html – the standard “public” folder for HTTP requests private_html – the standard “private” folder for HTTPS requests (e.g. secure content) I … Read more

url keeps redirecting to a page

I was able to solve the problem by just clearing the cache. If anyone facing similar issue you may try Deleting the browser cache, or trying in incognito mode Contact hosting as ask them to clear any server cache or disable any caching features they have Save the permalink again or delete the rewrite table … Read more

Redirect “any page/page/number/” to “any page”

I’d like to redirect in ht.access To clarify, it’s .htaccess, not ht.access. You can do something like the following at the top of the .htaccess file, before the existing WordPress directvies: RewriteRule (.*/)page/\d+/?$ /$1 [R=302,L] The above issues a 302 (temporary) redirect for any URL of the form /<something>/page/<number>/ (trailing slash optional) to /<something>/. The … Read more