.htaccess и htaccess.txt разное содержание

Тема в разделе "SEO - оптимизация, продвижение", создана пользователем evgenius74, 28.04.2011.

  1. evgenius74
    Offline

    evgenius74 Недавно здесь

    Регистрация:
    20.03.2011
    Сообщения:
    20
    Симпатии:
    0
    Пол:
    Мужской
    И снова перелопатил горы информации и не нашел подходящей для меня.
    В корне сайта у меня два файла .htaccess и htaccess.txt, разные размеры и соответственно содержание. Причем htaccess.txt больше. мне казалось что .htaccess является основным.
    1. Почему они разные по содержанию?
    2. В каком настраивать редирект на страницы?
    Заранее спасибо.
     
  2.  
  3. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
    По всей видимости, при редактировании .htaccess были добавлены/удалены какие-либо строки. Сравните два файла и посмотрите разницу - в чём проблема?

    .htaccess
     
  4. evgenius74
    Offline

    evgenius74 Недавно здесь

    Регистрация:
    20.03.2011
    Сообщения:
    20
    Симпатии:
    0
    Пол:
    Мужской
    вот .htaccess

    Код (CODE):
    1. DirectoryIndex index.php
    2. RewriteEngine On
    3. RewriteBase /skladdsk
    4.  
    5. ########## Begin - Rewrite rules to block out some common exploits
    6. ## If you experience problems on your site block out the operations listed below
    7. ## This attempts to block the most common type of exploit `attempts` to Joomla!
    8. #
    9. ## Deny access to extension xml files (uncomment out to activate)
    10. #<Files ~ "\.xml$">
    11. #Order allow,deny
    12. #Deny from all
    13. #Satisfy all
    14. #</Files>
    15. ## End of deny access to extension xml files
    16. # Block out any script trying to set a mosConfig value through the URL
    17. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
    18. # Block out any script trying to base64_encode crap to send via URL
    19. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
    20. # Block out any script that includes a <script> tag in URL
    21. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    22. # Block out any script trying to set a PHP GLOBALS variable via URL
    23. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    24. # Block out any script trying to modify a _REQUEST variable via URL
    25. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    26. # Send all blocked request to homepage with 403 Forbidden error!
    27. RewriteRule ^(.*)$ index.php [F,L]
    28. #
    29. ########## End - Rewrite rules to block out some common exploits
    30.  
    31. RewriteCond %{REQUEST_FILENAME} !-f
    32. RewriteCond %{REQUEST_FILENAME} !-d
    33. RewriteCond %{REQUEST_URI} !^/index.php
    34. RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
    35. RewriteRule (.*) index.php
    36. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]


    вот htaccess.txt
    Код (CODE):
    1. ##
    2. # @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
    3. # @package Joomla
    4. # @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
    5. # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
    6. # Joomla! is Free Software
    7. ##
    8.  
    9.  
    10. #####################################################
    11. #  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
    12. #
    13. # The line just below this section: 'Options +FollowSymLinks' may cause problems
    14. # with some server configurations.  It is required for use of mod_rewrite, but may already
    15. # be set by your server administrator in a way that dissallows changing it in
    16. # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
    17. # beginning of line), reload your site in your browser and test your sef url's.  If they work,
    18. # it has been set by your server administrator and you do not need it set here.
    19. #
    20. #####################################################
    21.  
    22. ##  Can be commented out if causes errors, see notes above.
    23. Options +FollowSymLinks
    24.  
    25. #
    26. #  mod_rewrite in use
    27.  
    28. RewriteEngine On
    29.  
    30. ########## Begin - Rewrite rules to block out some common exploits
    31. ## If you experience problems on your site block out the operations listed below
    32. ## This attempts to block the most common type of exploit `attempts` to Joomla!
    33. #
    34. ## Deny access to extension xml files (uncomment out to activate)
    35. #<Files ~ "\.xml$">
    36. #Order allow,deny
    37. #Deny from all
    38. #Satisfy all
    39. #</Files>
    40. ## End of deny access to extension xml files
    41. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
    42. # Block out any script trying to base64_encode crap to send via URL
    43. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
    44. # Block out any script that includes a <script> tag in URL
    45. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    46. # Block out any script trying to set a PHP GLOBALS variable via URL
    47. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    48. # Block out any script trying to modify a _REQUEST variable via URL
    49. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    50. # Send all blocked request to homepage with 403 Forbidden error!
    51. RewriteRule ^(.*)$ index.php [F,L]
    52. #
    53. ########## End - Rewrite rules to block out some common exploits
    54.  
    55. #  Uncomment following line if your webserver's URL
    56. #  is not directly related to physical file paths.
    57. #  Update Your Joomla! Directory (just / for root)
    58.  
    59. # RewriteBase /
    60.  
    61.  
    62. ########## Begin - Joomla! core SEF Section
    63. #
    64. RewriteCond %{REQUEST_FILENAME} !-f
    65. RewriteCond %{REQUEST_FILENAME} !-d
    66. RewriteCond %{REQUEST_URI} !^/index.php
    67. RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
    68. RewriteRule (.*) index.php
    69. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    70. #
    71. ########## End - Joomla! core SEF Section


    то есть если один меньше это не значит что он ущербный?)
     
  5. alex0603
    Offline

    alex0603 Недавно здесь => Cпециалист <=

    Регистрация:
    25.11.2007
    Сообщения:
    415
    Симпатии:
    39
    Пол:
    Мужской
    htaccess.txt у тебя джумловский стандартный. нафиг не нужный ибо у тебя уже есть .htaccess - нужный и с нужными настройками. =) как то так.
     
  6. evgenius74
    Offline

    evgenius74 Недавно здесь

    Регистрация:
    20.03.2011
    Сообщения:
    20
    Симпатии:
    0
    Пол:
    Мужской
    Спасибо уяснил. Можно в этой же теме про редирект в .htaccess?
    У сайта домен остался тот же но URL-ы в силу перехода на joomla сменились.
    Старый был к примеру:
    Код (CODE):
    1. http://www.site.ru/price/product-01-5/


    Новый же:
    Код (CODE):
    1. http://www.site.ru/index.php/pallet-trucks/pallet-trucks-pfaff-silberblau.html


    Пробовал прописывать так:
    Код (CODE):
    1. Redirect 301 /price/product-01-5/ /index.php/pallet-trucks/pallet-trucks-pfaff-silberblau.html

    не получается 500 выдает при переходе по старому адресу

    может эту строчку нужно во что то заключать? перерыл кучу информации, не нашел в чем может быть проблема.
    Прошу совета
     
  7. alex0603
    Offline

    alex0603 Недавно здесь => Cпециалист <=

    Регистрация:
    25.11.2007
    Сообщения:
    415
    Симпатии:
    39
    Пол:
    Мужской
    если так хочется поморочиться с редиректами - поставь компонент редиректа - всяко проще будет;)
     
  8. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
    По моему так должно быть

    Код (html):
    1. Redirect 301 /price/product-01-5/ http://www.site.ru/index.php/pallet-trucks/pallet-trucks-pfaff-silberblau.html


    Т.е. нужно указывать адрес сайта во втором случае.
     
  9. alex0603
    Offline

    alex0603 Недавно здесь => Cпециалист <=

    Регистрация:
    25.11.2007
    Сообщения:
    415
    Симпатии:
    39
    Пол:
    Мужской
    Кстати вроде да
     
  10. evgenius74
    Offline

    evgenius74 Недавно здесь

    Регистрация:
    20.03.2011
    Сообщения:
    20
    Симпатии:
    0
    Пол:
    Мужской
    Опа!!! Ребята, от души!!! Прям спасибос большой. Столько раз видел это, но думал раз домен не менялся то и указывать его не надо. А тут по вашему совету решил попробовать и всё заработало!
    Вообщем не хватало http://www.site.ru перед новым url
     
  11. alex0603
    Offline

    alex0603 Недавно здесь => Cпециалист <=

    Регистрация:
    25.11.2007
    Сообщения:
    415
    Симпатии:
    39
    Пол:
    Мужской
    всегда рады помочь)
     
  12. Offline

    bios Недавно здесь

    Регистрация:
    30.03.2011
    Сообщения:
    33
    Симпатии:
    2
    Пол:
    Мужской
    ТОже сталкнулся с такой бедой :

    Содержимое оригинального .htaccess :

    <Files ~ (\.php)>
    Options +FollowSymLinks
    </Files>
    DirectoryIndex index.php index.html index.html.var index.shtml index.cfm index.htm


    Содержимое оригинального htaccess.txt :

    ##
    # @version $Id: htaccess.txt 21101 2011-04-07 15:47:33Z dextercowley $
    # @package Joomla
    # @copyright Copyright (C) 2005 - 2011 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]
    #
    ## End - Joomla! core SEF Section.


    ПОдскажите что должно быть в .htaccess для корректной работы?
     
  13. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
    Скопируйте текст из htaccess.txt и вставьте в .htaccess

    Ко всем, у кого возникают подобные проблемы: Поймите принцип, htaccess.txt - это и есть нужный файл .htaccess, необходимый Joomla для работы с поддержкой ЧПУ, просто по умолчанию в дистрибутиве он не переименован.
     
    bios нравится это.
  14. Offline

    bios Недавно здесь

    Регистрация:
    30.03.2011
    Сообщения:
    33
    Симпатии:
    2
    Пол:
    Мужской
    а код из оригинального .htaccess :

    <Files ~ (\.php)>
    Options +FollowSymLinks
    </Files>
    DirectoryIndex index.php index.html index.html.var index.shtml index.cfm index.htm

    НАдо удалить?
     
  15. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
    Можете вообще удалить .htaccess и просто переименовать htaccess.txt
     
  16. Offline

    bios Недавно здесь

    Регистрация:
    30.03.2011
    Сообщения:
    33
    Симпатии:
    2
    Пол:
    Мужской
  17. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
  18. DKraev
    Offline

    DKraev <i>(aka gft)</i> => Cпециалист <=

    Регистрация:
    16.08.2008
    Сообщения:
    1 627
    Симпатии:
    219
    Пол:
    Мужской
    И ещё. НА странице написано:

    Делали?
     
  19. Offline

    bios Недавно здесь

    Регистрация:
    30.03.2011
    Сообщения:
    33
    Симпатии:
    2
    Пол:
    Мужской
    Добавил.
    Я просто хотел узнать, мб это не признак не смовсем корректной работы сайта.
    И кеш обновлял.
    Как только добавил строчку обратно, все загрузилось.
     
  20. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    Извините что вмешиваюсь.
    Эта директива для сервера-с каким расширением файлы искать/загружать.
     
    bios нравится это.

Поделиться этой страницей

Загрузка...