Новости Joomla

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

antira30

  • Осваиваюсь на форуме
  • 12
  • 0 / 1
Здравствуйте! Прошу помощи!

Входные параметры:
- Сайт на Joomla 3.1.0

Проблема-1.
Необходимо настроить редирект так, что бы он переводил все неверно введенные (как в примере) адреса на URL оформленный по правилам:
- с www. в начале
-без index.php
-без home.html.
Пример:
с URL http://antarcom.ru/vozdukhonagrevatelnye-agregaty-avn.html на http://www.antarcom.ru/vozdukhonagrevatelnye-agregaty-avn.html
с URL http://antarcom.ru/ на http://www.antarcom.ru/

На данный момент решение отрабатывает через двойной редирект(хотя так не задумывалось, непонятно откуда берется двойной). То есть алгоритм судя по сайту проверки (http://www.bertal.ru/) отрабатывает так:
http://antarcom.ru/obshchaya-kharakteristika-klimaticheskoj-sistemy.html - >
http://www.antarcom.ru/index.php ->
http://www.antarcom.ru
ЗАДАЧА 1: Убрать двойной редирект. И на данный момент все такие ссылки переводятся на главную страницу, что то же надо прекратить и сохранить требуемую страницу.


Проблема -2
Проблема с XML картой сайта. Имеется редирект:
с http://www.antarcom.ru/sitemap.xml            на             http://www.antarcom.ru/index.php?option=com_xmap&view=xml&tmpl=component&id=1.
Необходимо что бы ответ сервера при запросе адреса XML карты составлял 200 ок.  Как я понимаю необходимо разместить карту сайта прямо по адресу .../sitemap.xml , что бы получить 200 ок.
Пользуюсь программкой Xmap для работы с картой сайта.
ЗАДАЧА 2: Как лучше и правильно сделать карту сайта, что бы получить  200 ок?  Конечно, не хотелось бы лишаться блага автоматической сборки карты .


! Все проверки работы редиректов выполнялись на бесплатном ресурсе http://www.bertal.ru/

Сейчас файл .htaccess  выглядит так:
Код
DirectoryIndex index.php
AddType application/x-httpd-php53 .php .html .htm .phtml

##
# @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

## 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]
php_value magic_quotes_gpc Off
#
## End - Joomla! core SEF Section.

#карта сайта
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&view=xml&tmpl=component&id=1 [R=301,L]

#в случае en
RewriteEngine On
Redirect 301 /en http://www.antarcom.ru

#в случае ru
RewriteEngine On
Redirect 301 /ru http://www.antarcom.ru

#в случае home.html
RewriteEngine On
Redirect 301 /home.html http://www.antarcom.ru

#INDEX.PHP------------------------------------------------------------------------
########## Begin - Custom redirects
########## Actions : Redir any other domains or non www to www. Removes index.php from home and any internal pages

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.antarcom.ru/$1 [R=301,L]

RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.antarcom.ru/$1 [R=301,L]

# Remove index.php from sub pages e.g. http://www.antarcom.ru/index.php/about --> http://www.antarcom.ru/about
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.antarcom.ru/$1$3 [R=301,L]

RewriteCond %{HTTP_HOST} !^(www\.antarcom\.ru)?$
RewriteRule (.*) http://www.antarcom.ru/$1 [R=301,L]
#
########## End - 301 Redirect
########## End - Custom redirects

#WWW----------------------------------------------------------------------------------------------------
#в случае без www на с www
#RewriteEngine On
#RewriteCond %{HTTP_HOST} ^antarcom.ru$ [NC]
#RewriteRule ^(.*)$ http://www.antarcom.ru [R=301]


*

antira30

  • Осваиваюсь на форуме
  • 12
  • 0 / 1
Re: Два вопроса по настройке.htaccess
« Ответ #1 : 25.02.2015, 18:52:10 »
тема для меня еще актуальна  =(     
*

Schumaker

  • Захожу иногда
  • 92
  • 4 / 0
Re: Два вопроса по настройке.htaccess
« Ответ #2 : 26.02.2015, 10:34:47 »
хитасису вообще по-барабану, какая у Вас Joomla (да и вообще, есть она на сайте или там лежат просто файлы, созданные в блокноте).
А про замену "www" на "без www" и тп. есть подробная и исчерпывающая тема на форуме, повторять её не имеет смысла. Кнопка "Поиск" поможет решить часть "актуальной проблемы".
*

antira30

  • Осваиваюсь на форуме
  • 12
  • 0 / 1
Re: Два вопроса по настройке.htaccess
« Ответ #3 : 15.03.2015, 23:55:14 »
проблема с двойным редиректом решена
проблема с картой решена

Тему можно убрать
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Как сделать универсальный редирект в htaccess?

Автор Lemonez

Ответов: 3
Просмотров: 501
Последний ответ 16.02.2022, 00:38:09
от gartes
Файлы.htaccess и webconfig

Автор xandr555

Ответов: 7
Просмотров: 867
Последний ответ 16.12.2019, 11:54:01
от AlexB
htaccess - переадрессация всех страниц на одну, как?

Автор x1

Ответов: 6
Просмотров: 836
Последний ответ 23.11.2019, 21:38:04
от x1
Перебрасывает на главную при защите папки паролем через.htaccess

Автор geomant

Ответов: 0
Просмотров: 1311
Последний ответ 23.11.2019, 07:46:00
от geomant
Вопрос по.htaccess & web.config обновление безопасности

Автор NatFree

Ответов: 3
Просмотров: 1605
Последний ответ 20.10.2019, 18:54:48
от NatFree