• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Resolved 301-Redirect

othmaqsa

Regular Pleskian
Server operating system version
Ubuntu 20.04.5 LTS
Plesk version and microupdate number
Version 18.0.47 Update #2
Hello,

I can't find the option on Plesk to create a 301-Redirect.

What I want to do is to create several permanent redirects (example: redirect a visitor from www.mysite.com/products/a to www.mysite.com/product/a) in order to remove all "404 not found" errors in the search console)

Thanks for your help.
 
301 redirects are created in the sites .htaccess file e.g.
Code:
Redirect 301 /oldpage.html https://www.example.com/newpage.html
 
301 redirects are created in the sites .htaccess file e.g.
Code:
Redirect 301 /oldpage.html https://www.example.com/newpage.html
Hello @Dave W ,

I use NGINX. I forgot to mention it.

There is any any directive which can solve this ?

Thank you in advance.
 
- Go to Websites & Domains > Your Subscription > Apache & nginx Settings
- Scroll down to the "Additional nginx directives" section
- Add the following code to the text box provided, using the target domain instead of example.com

Code:
return 301 https://example.com$request_uri;
 
Hello,

I found a solution which consists of placing this code in functions.php and replacing /old-slug and /new-slug with the appropriate values.

Code:
function quadlayers_redirect() {

if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$protocol = 'https://';
}
else {
$protocol = 'http://';
}
$currenturl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$currenturl_relative = wp_make_link_relative($currenturl);

switch ($currenturl_relative) {

case '/old-slug':
$urlto = home_url('/new-slug');
break;

default:
return;

}

if ($currenturl != $urlto)
exit( wp_redirect( $urlto ) );
}
add_action( 'template_redirect', 'quadlayers_redirect' );
 
Back
Top