Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 6 Ответов
  • 5304 Просмотров
*

rutravnik

  • Новичок
  • 6
  • 0 / 0
Привет. Никак в Joomla 3.0 не удается реализовать "перенаправление с шаблоном". В результате должно получиться следующее: если набрать в адресной строке, например, http://www.site.ru/uroki.html, то пользователь будет автоматически перемещен на ту же страницу, только без www – http://site.ru/uroki.html. В итоге выбрасывает на http://site.ru/index.php если страница существует. Если страница не существует, то переадресация срабатывает верно.

Прилагаю код, прошу помочь, где ошибка. Заранее спасибо.

Код
##
# @package Joomla
# @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# 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\.site\.ru
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,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!
#
# 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 something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|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.
« Последнее редактирование: 02.12.2012, 13:17:58 от b2z »
*

wishlight

  • Живу я здесь
  • 4980
  • 293 / 1
  • от 150 руб быстрый хостинг без блокировок
*

rutravnik

  • Новичок
  • 6
  • 0 / 0
Re: Перенаправление с WWW.site.ru на site.ru
« Ответ #2 : 02.12.2012, 11:57:49 »
SEO Canonicalisation Plugin

Спасибо Вам, установил, вроде работает как надо. Я только вбил хост без www, и больше ничего не настраивал, никаких галочек не ставил, сохранил и включил. Этого достаточно? Просто там всё на буржуйском...
*

wishlight

  • Живу я здесь
  • 4980
  • 293 / 1
  • от 150 руб быстрый хостинг без блокировок
*

ValeiY

  • Новичок
  • 5
  • 0 / 0
RE: Перенаправление с www.site.ru на site.ru
« Ответ #4 : 28.12.2012, 11:44:18 »
Плагин сняли с публикации, есть у кого файлик?
У меня вообще редирект не работает
код
Спойлер
[свернуть]

Может склейку сюда вставлять или нет разницы?
Код
## 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
*

ValeiY

  • Новичок
  • 5
  • 0 / 0
RE: Перенаправление с www.site.ru на site.ru
« Ответ #6 : 28.12.2012, 13:05:39 »
Как сделать правильный редирект
Попробовал предложенные в теме варианты. Вставлял сразу за RewriteEngine On и в специально отведенное место, безрезультатно
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Call to a member function NewColorizeImage() on null при переходе PHP 7 [Решено]

Автор Eholov

Ответов: 3
Просмотров: 2413
Последний ответ 17.03.2023, 11:03:04
от Olexa
После обновления Joomla до версии 3.9.23 проблема сохранения материала (Решено)

Автор yarek

Ответов: 6
Просмотров: 1097
Последний ответ 23.01.2021, 20:42:45
от wishlight
Ошибка при авторизации в админке [Решено]

Автор flat

Ответов: 0
Просмотров: 1008
Последний ответ 03.12.2020, 05:29:16
от flat
Перенаправление

Автор Артём46

Ответов: 8
Просмотров: 540
Последний ответ 22.07.2020, 15:21:14
от Артём46
[Решено. Причина не найдена] Failed to read session data Joomla 3.8.1 php 7.1.11

Автор capricorn

Ответов: 6
Просмотров: 11780
Последний ответ 17.07.2020, 03:33:08
от d1KdaT