Редирект без www

V
На сайте с 21.06.2007
Offline
124
1077

Занялся одним заброшенным сайтом для компании, годичной давности. Буквально вчера позавчера кинул тексты, изначально редирект не подкорректировал, думал все норм. Оказалось что сайт везде по разному виден и с www и без www. Нужен вид http://сайт.ru без www Сам домен сайт santegclean.ru Собственно на яндексе вебм хочет добавляться только с www, решил поменять robot.txt и выставил редирект на http://сайт.ru в файле .htaccess в итоге сайту пришел "конец"

выдается сообщение в браузере:

Неверное перенаправление на странице

Firefox определил, что сервер перенаправляет запрос на этот адрес таким образом, что он никогда не завершится.

Эта проблема может возникать при отключении или запрещении принятия кук.

Пока ниче не менял решил сразу сюда

текст robot. txt

User-agent: *
Disallow: /administrator/
Disallow: /cache/
Disallow: /components/
Disallow: /images/
Disallow: /includes/
Disallow: /installation/
Disallow: /language/
Disallow: /libraries/
Disallow: /media/
Disallow: /modules/
Disallow: /plugins/
Disallow: /templates/
Disallow: /tmp/
Disallow: /xmlrpc/
Sitemap: http://santegclean.ru/index.php?option=com_xmap&sitemap=1&view=xml
User-agent: Yandex
Disallow: /administrator/
Disallow: /cache/
Disallow: /components/
Disallow: /images/
Disallow: /includes/
Disallow: /installation/
Disallow: /language/
Disallow: /libraries/
Disallow: /media/
Disallow: /modules/
Disallow: /plugins/
Disallow: /templates/
Disallow: /tmp/
Disallow: /xmlrpc/
Host: santegclean.ru
Sitemap: http://santegclean.ru/index.php?option=com_xmap&sitemap=1&view=xml

Код .htaccess

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)(.*)$
RewriteRule ^(.*) http://%2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^(santgclean\.ru)$
RewriteRule ^(.*) http://santegclean.ru/$1 [R=301,L]
RewriteRule ^robots.txt$ - [L]

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
########## End - Custom redirects


# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section

Что нужно исправить подскажите?

---------- Добавлено 30.01.2012 в 19:12 ----------

Извиняюсь, все проблема, решилась, оказалась ошибка в коде сразу не заметил. Еще один вопрос чтобы яндекс изменил главное зеркало сайта, нужно только зеркала в робот.тхт поменять? и дождаться индексации? Или все таки в панели вебмастера что-то делать нужно? Так как пока он у меня хочет добавлять только сайт с www.

А гугл тулс для того чтобы выделить главное зеркало требует права на другое как их послать ему не понятно?

Компания по устройству буронабивных свай (https://drilling-msk.ru/)
Drums
На сайте с 13.02.2011
Offline
81
#1
Vitiai:
А гугл тулс для того чтобы выделить главное зеркало требует права на другое как их послать ему не понятно?

В гуглотулзе надо оба варианта зарегить - с www и без, а потом указать на нужный.

ЗЫ. В хтакцессе ошибка в самом начале.

Шустрые и стабильные VDS на SSD дисках (http://articleland.ru/get/host.php) за 3.49/мес
V
На сайте с 21.06.2007
Offline
124
#2
Drums:
В гуглотулзе надо оба варианта зарегить - с www и без, а потом указать на нужный.

ЗЫ. В хтакцессе ошибка в самом начале.

А в яндекс тулсе что делать? добавлять с www? или подождать пока он сам проиндексирует его и определит главное зеркало правильное, или можно добавить с www, а в тулсе он потом сам исправиться?

Drums
На сайте с 13.02.2011
Offline
81
#3

Vitiai, А в яндексе можно сразу указать, без извратов как у гугла. Хотя у тебя хост прописан в роботсе, этого яше тоже хватит.

V
На сайте с 21.06.2007
Offline
124
#4

Ок спасибо!

L
На сайте с 20.03.2012
Offline
38
#5

Доброго дня! Аналогичная проблема:( Сайт на joomla: http://face-building.com.

Код .htaccess:

DirectoryIndex index.php

RewriteEngine On

RewriteBase /

########## Begin - Rewrite rules to block out some common exploits

## If you experience problems on your site block out the operations listed below

## This attempts to block the most common type of exploit `attempts` to Joomla!

#

## Deny access to extension xml files (uncomment out to activate)

#<Files ~ "\.xml$">

#Order allow,deny

#Deny from all

#Satisfy all

#</Files>

## End of deny access to extension xml files

# Block out any script trying to set a mosConfig value through the URL

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]

# Block out any script trying to base64_encode crap to send via URL

RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]

# Block out any script that includes a <script> tag in URL

RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

# Block out any script trying to set a PHP GLOBALS variable via URL

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

# Block out any script trying to modify a _REQUEST variable via URL

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

# Send all blocked request to homepage with 403 Forbidden error!

RewriteRule ^(.*)$ index.php [F,L]

#

########## End - Rewrite rules to block out some common exploits

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !^/index.php

RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]

RewriteRule (.*) index.php

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

при вставке правила целиком (или только 3-4 строчек):

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.face-building\.com$ [NC]

RewriteRule ^(.*)$ http://face-building.com/$1 [R=301,L]

Получаю ошибку: "Firefox определил, что сервер перенаправляет запрос на этот адрес таким образом, что он никогда не завершится" Т.е. похоже зациклились :(((

Буду благодарна за помощь в настройке правильного редиректа.

L
На сайте с 20.03.2012
Offline
38
#6

Спасибо за помощь и быстрый ответ Академику: siv1987.

Благодарность от сайта Фейсбилдинг - гимнастика для лица

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий