Помощник
|
Настройка файлов «Robots.txt» и «.htaccess» на Joomla |
BTMG
|
Сообщение
#1
|
||
|
|
||
|
|||
ekvador |
2.7.2012, 21:42;
Ответить: ekvador
Сообщение
#2
|
|
Как по мне, в роботс нужно еще добавить:
Развернуть/Свернуть
Disallow: /*?
Disallow: /search Disallow: /index.php Disallow: /index.html Disallow: /404 Disallow: /*=atom Disallow: /*=rss в htaccess еще добавить код для редиректа с index: Развернуть/Свернуть
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ / [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ / [R=301,L] Сообщение отредактировал ekvador - 2.7.2012, 21:47 |
|
|
EvilPanda |
3.7.2012, 10:37;
Ответить: EvilPanda
Сообщение
#3
|
|
Джумлу не очень люблю и всех нюансов не знал. Узнал про /images/ хоть сейчас и не нужно, но все равно полезно, спасибо, даем старт
-------------------- |
|
|
lostprophet |
3.7.2012, 10:48;
Ответить: lostprophet
Сообщение
#4
|
|
Первым делом надо убрать строку «Disallow: /images/» иначе сайт не будет участвовать в поиске картинок Гугла и Яндекса, что заметно повлияет на посещаемость. Внесу свои 5 копеек. Всю папку открывать не стоит, ибо в индекс попадет куча служебной графики, обойтись же можно правилом типа Allow: /images/stories* Disallow: /images/ Вместо "stories*" можно использовать любой путь до папки с изображениями, которые непосредственно вставляются в материалы Вашего сайта. по стандартным настройкам Джумлы этот файл не содержит никакого текста. O_o А вот с этого места поподробнее. Чистый .htaccess 1.5.25 Развернуть/Свернуть
##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $ # @package Joomla # @copyright Copyright © 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 ########## 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 -------------------- |
|
|
BTMG
|
Сообщение
#5
|
|
ekvador и lostprophet, большое спасибо за внесенные вами поправки. Да, оказалось, что в моей статье есть недочеты, поэтому если кто знает еще, что-то полезное на эту тему пишите в этом топике. Вскоре постараюсь написать более полезную, точную и интересную статью.
|
|
|
eLearner |
3.7.2012, 18:53;
Ответить: eLearner
Сообщение
#6
|
|
По-моему, в стандартный джумловский .htaccess (1.5) стоит добавить:
##### Start ?tp=1 prevention ###### RewriteCond %{QUERY_STRING} =tp=1 RewriteRule ^(.*)$ index.php [F,L] ##### End ?tp=1 prevention ###### чтобы отключить хак с ?tp=1. В более поздних версиях он отключен по умолчанию в настройках шаблона. -------------------- |
|
|
rubroker |
3.7.2012, 20:35;
Ответить: rubroker
Сообщение
#7
|
|
Попробуй набрать, например, ?tp=eLearner
Сообщение отредактировал lostprophet - 3.7.2012, 20:40
Причина редактирования: избыточное цитирование
|
|
|
eLearner |
4.7.2012, 2:57;
Ответить: eLearner
Сообщение
#8
|
|
Чтобы работало не только с единичкой, можно использовать:
##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp(=.*) RewriteRule ^(.*)$ index.php [F,L] ##### End ?tp=1 prevention ###### -------------------- |
|
|
topsmiling |
4.7.2012, 11:07;
Ответить: topsmiling
Сообщение
#9
|
|
|
Я еще обычно закрываю от индекса страницы из навигации по страницам. В категориях ладно, еще можно оставить, а вот с главной страницы я бы закрыл...
Disallow: /*?start=
Сообщение отредактировал topsmiling - 4.7.2012, 11:08 -------------------- |
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Комплексное продвижение в соцсетях: аудит, оформление, ведение и настройка рекламных кампаний. Качественно и по вкусным ценам. |
91 | WildWeb8 | 62564 | 17.1.2024, 13:04 автор: WildWeb8 |
|
Разработка сайтов Joomla Wordpress Opencart Разработка, верстка, оптимизация веб сайтов. |
77 | WoWeb | 40291 | 3.9.2023, 16:52 автор: Sawich |
|
[Продам] базы сайтов на CMS Wordpress/Joomla/Drupal/Magento/... | 14 | phosphoruss | 13673 | 16.8.2023, 15:27 автор: SmmPanelUS |
|
Техподдержка сайтов на движках Joomla, Netcat, Opencart | 5 | 54web | 4258 | 22.1.2023, 13:27 автор: kikimora17 |
|
Настройка яндекс директ рекламы БЕЗ РАСХОДОВ БЮДЖЕТА Количество продаж будет ОГРАНИЧЕННО! |
21 | ITstaf | 4213 | 7.11.2022, 16:31 автор: ITstaf |
Текстовая версия | Сейчас: 28.3.2024, 18:52 |