L
L
ligisayan2021-03-05 12:12:41
WordPress
ligisayan, 2021-03-05 12:12:41

How to redirect from www to non-www in yoast seo?

Hello!
I have a wordpress site with the Yoast SEO plugin installed
How to set up a 301 redirect from www to non-www using yoast seo simple redirect or RegEx?
(but not through htaccess | nginx)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2021-03-05
@azerphoenix

Good afternoon!
In general, it is better to configure this through htaccess for Apache or through nginx configs.
Even Yoast itself talks about it.
https://yoast.com/how-to-remove-www-from-your-url/
https://yoast.com/video/ask-yoast-redirecting-domain/
But if for some reason you don't want to do it at the config level, then do it at the PHP level
https://stackoverflow.com/questions/2079457/www-to...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question