T
T
Tratil199002016-08-11 11:08:26
Search Engine Optimization
Tratil19900, 2016-08-11 11:08:26

How to set up a 301 redirect for html?

Good afternoon, I have a website, consists of html pages. The domain name is pas82.ru. When I do a site analysis, it gives a duplicate of the index.html main page and just / . Tried to set it up myself, didn't work. I would like to redirect from index.html to pas82.ru. And also redirection from www.pas82.ru to pas82.ru. Here's what I currently have
in .htaccess:
AddDefaultCharset utf-8
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Олег Мифле, 2016-08-11
@OlegMifle

Как-то так попробуй. В .htaccess засунуть это

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]

RewriteCond %{REQUEST_URI} /index.html
RewriteCond %{QUERY_STRING} ^\z
RewriteRule ^(.*)$ http://pas82.ru/? [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question