Решено! Не работает URL rewriting на сервере хостинга.

Тема в разделе "Ошибки при работе с Joomla", создана пользователем Belek, 28.07.2014.

  1. Offline

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

    Регистрация:
    28.07.2014
    Сообщения:
    3
    Симпатии:
    0
    Привет.

    После загрузки сайта на хостинг перестали работать любые страницы сайта, кроме домашней. Выдовало 500 ошибку.
    Я переименовал файл .htaccess обратно в htaccess.txt и отключил в админке функцию "Use URL Rewriting". Тогда страницы зработали. Но теперь, на какую-либо страницу я бы не перешел, url содержит index.php.

    Гуглил. Понял, что чтобы устранить проблему нужно как-то настроить файл .htaccess. Но я не могу решить эту проблему. Ниже приведено содержимое моего файла.

    Спасибо!

    P.S. На локальной машине все прекрассно работает. Файл мой .htaccess и функции Use URL Rewriting и Search Engine Friendly URLs включены.

    Код (CODE):
    1. ##
    2. # @package    Joomla
    3. # @copyright  Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
    4. # @license    GNU General Public License version 2 or later; see LICENSE.txt
    5. ##
    6.  
    7. ##
    8. # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
    9. #
    10. # The line just below this section: 'Options +FollowSymLinks' may cause problems
    11. # with some server configurations.  It is required for use of mod_rewrite, but may already
    12. # be set by your server administrator in a way that dissallows changing it in
    13. # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
    14. # beginning of line), reload your site in your browser and test your sef url's.  If they work,
    15. # it has been set by your server administrator and you do not need it set here.
    16. ##
    17.  
    18. ## Can be commented out if causes errors, see notes above.
    19. #Options +FollowSymLinks
    20.  
    21. ## Mod_rewrite in use.
    22.  
    23. RewriteEngine On
    24.  
    25. ## Begin - Rewrite rules to block out some common exploits.
    26. # If you experience problems on your site block out the operations listed below
    27. # This attempts to block the most common type of exploit `attempts` to Joomla!
    28. #
    29. # Block out any script trying to base64_encode data within the URL.
    30. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
    31. # Block out any script that includes a <script> tag in URL.
    32. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
    33. # Block out any script trying to set a PHP GLOBALS variable via URL.
    34. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    35. # Block out any script trying to modify a _REQUEST variable via URL.
    36. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    37. # Return 403 Forbidden header and show the content of the root homepage
    38. RewriteRule .* index.php [F]
    39. #
    40. ## End - Rewrite rules to block out some common exploits.
    41.  
    42. ## Begin - Custom redirects
    43. #
    44. # If you need to redirect some pages, or set a canonical non-www to
    45. # www redirect (or vice versa), place that code here. Ensure those
    46. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
    47. #
    48. ## End - Custom redirects
    49.  
    50. ##
    51. # Uncomment following line if your webserver's URL
    52. # is not directly related to physical file paths.
    53. # Update Your Joomla! Directory (just / for root).
    54. ##
    55.  
    56. # RewriteBase /
    57.  
    58. ## Begin - Joomla! core SEF Section.
    59. #
    60. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    61. #
    62. # If the requested path and file is not /index.php and the request
    63. # has not already been internally rewritten to the index.php script
    64. RewriteCond %{REQUEST_URI} !^/index\.php
    65. # and the requested path and file doesn't directly match a physical file
    66. RewriteCond %{REQUEST_FILENAME} !-f
    67. # and the requested path and file doesn't directly match a physical folder
    68. RewriteCond %{REQUEST_FILENAME} !-d
    69. # internally rewrite the request to the index.php script
    70. RewriteRule .* index.php [L]
    71. #
    72. ## End - Joomla! core SEF Section.
     
  2.  
  3. OlegK
    Offline

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

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    Хостер разрешает использовать .htaccess ? Стучи к хостеру.
     
    Belek нравится это.
  4. Offline

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

    Регистрация:
    28.07.2014
    Сообщения:
    3
    Симпатии:
    0
    Хорошо, напишу. Спасибо за отзыв. Как дадут ответ, отпишусь. А вообще, что делать если хостер не разрешит использовать этот файл?

    Update:
    .htaccess использовать можно. Нужно 604 разрешение. Где и как это нужно настраивать?
    Спасибо!
     
    Последнее редактирование: 28.07.2014
  5. OlegK
    Offline

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

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    FileZilla - фтп клиент.
     
    Belek нравится это.
  6. Offline

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

    Регистрация:
    28.07.2014
    Сообщения:
    3
    Симпатии:
    0
    Спасибо вам большое! Выставил 604 permission и все заработало. Никаких index.php в адрессной строке.
     

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

Загрузка...