• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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