301 Redirect from HTTP to HTTPS - Advanced SEO
The Magic Code:
# SSL Rewrite
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourwebsite/$1 [R=301,L]
Today we're going to be talking about how to set up an HTTP to HTTPS 301 redirect. Recently I was going through my Moz Pro membership and I was looking at all of our redirects, making sure that everything was done correctly, and I noticed when I had done the SSL something had gone from HTTP to HTTPS, which was great. I've got a nice little article on it. The problem was it was a 302. Now, this is a simple problem to fix so here's how we're going to talk about how to go from a 302, which is pretty standard in most of the resources you find on how to go from HTTP to HTTPS, to go to 301 so we pass all that link equity. It's a really important little thing to do.
Here's what we're going to do. We're going to go over to our cPanel and we'll go to our .htaccess file. So first the little public_html, we've got multiple websites on here. We'll get our .htaccess file, edit. You can just do it all in here. No need to go through the FTP. You're going to see right here the code that we're going to use for it. Super, super simple, so it's rewrite engine on, rewrite condition, rewrite rule, and then you can just do HTTPS right here directiveconsulting.com.
Here's the tricky part, R=301 this is redirect equals 301. Here's a number one ranking article normally on this I found. It's 301 redirect from HTTP to HTTPS. But what they did was they only gave me this rl. Now I'm not a programmer and I don't have necessarily all the expertise I want yet, but what I noticed was that this was sending it as a 302 instead of a 301.
We do the equals 301, we'll get that what we want. Then it's a WordPress site so to make sure everything was firing correctly I just used this HTTPS plug-in. You guys see my settings right here. Super, super simple basic settings, nothing crazy done, and now I got this nice little site lock and everything's working perfectly.
Thanks for watching and once again what you're going to want to do to get your 301 redirect from HTTP to HTTPS, go to your .htaccess file, click edit, copy paste. Don't forget to change your domain here. All you have to do is copy this code and from there you're good to roll.
Thank you for watching and this is the first episode of Search Cast. Thank you.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «301 Redirect from HTTP to HTTPS - Advanced SEO», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.