Z
Z
ZeroMorale2018-04-05 15:04:12
Search Engine Optimization
ZeroMorale, 2018-04-05 15:04:12

How to set up a 301 redirect from an internal page to the main page?

Hello. How to set up a custom 301 redirect from site.ru/main to site.ru

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Felix_vek, 2018-04-05
@Felix_vek

Rules for configuring the .htaccess file for a 301 redirect:
At the same time, the new address must be specified in full with http or https and a domain name

I
Igor Mavlikhanov, 2018-04-05
@Gori4ka

function action_function_name_11() {
  // Проверки и прочее
wp_safe_redirect( $location, 301);

}
add_action( 'template_redirect', 'action_function_name_11' );

https://wp-kama.ru/hook/template_redirect
https://codex.wordpress.org/Function_Reference/wp_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question