Абсолютно во всех разделах сайта 404 ошибка

Тема в разделе "Ошибки и их решения", создана пользователем ЕленаЧ, 6 окт 2019.

  1. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    Абсолютно во всех разделах 404 ошибка, ЧПУ есть, а стр нет
    upload_2019-10-6_17-16-24.png

    Файл без TXT, кеш чистила. что дальше делать, даже не знаю. Подскажите, пожалуйста!

    upload_2019-10-6_17-18-57.png

     
  2. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
  3. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    htaccess -

    <Files *.*>
    Order Deny,Allow
    Deny from all
    </Files>
    <Files ~ "\.(js|css)$">
    Order Allow,Deny
    Allow from all
    </Files>
     
  4. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
    А должно быть, хотя бы так


    Код:
    # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
    
    # 2. In your opencart directory rename htaccess.txt to .htaccess.
    
    # For any support issues please visit: http://www.opencart.com
    
    Options +FollowSymlinks
    
    # Prevent Directoy listing
    Options -Indexes
    
    # Prevent Direct Access to files
    <FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
     Require all denied
    ## For apache 2.2 and older, replace "Require all denied" with these two lines :
    # Order deny,allow
    # Deny from all
    </FilesMatch>
    
    # SEO URL Settings
    RewriteEngine On
    
    
    # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
    
    RewriteBase /
    RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
    RewriteRule ^sitemap_pro.xml$ index.php?route=extension/feed/sitemap_pro [L]
    RewriteRule ^yandex_feed.xml$ index.php?route=extension/feed/yandex_feed [L]
    RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
    
     
  5. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    Простите за глупый. наверное, вопрос
    Я должна сразу после этого текста

    <Files *.*>
    Order Deny,Allow
    Deny from all
    </Files>
    <Files ~ "\.(js|css)$">
    Order Allow,Deny
    Allow from all
    </Files>

    1.Размещать это
    # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

    # 2. In your opencart directory rename htaccess.txt to .htaccess.

    # For any support issues please visit: http://www.opencart.com

    Options +FollowSymlinks

    # Prevent Directoy listing
    Options -Indexes

    # Prevent Direct Access to files
    <FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
    Require all denied
    ## For apache 2.2 and older, replace "Require all denied" with these two lines :
    # Order deny,allow
    # Deny from all
    </FilesMatch>

    # SEO URL Settings
    RewriteEngine On


    # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
    2.или разместить только это
    RewriteBase /
    RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
    RewriteRule ^sitemap_pro.xml$ index.php?route=extension/feed/sitemap_pro [L]
    RewriteRule ^yandex_feed.xml$ index.php?route=extension/feed/yandex_feed [L]
    RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

    или и 1 и 2

    Функциональные модули и модификаторы для OpenCart 2x
     
  6. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
    Я вам привел минимальную конфигурацию htaccess

    К чему самостоятельность?
     
  7. Vlad

    Vlad Эксперт

    Сообщения:
    4.129
    Симпатии:
    999
    htacces находится в корне сайта, там где index.php и robots.txt
    Другие трогать не нужно.
     
  8. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
    У нее в корне, но от практически пустой..
     
  9. SiteMix

    SiteMix Продвинутый пользователь

    Сообщения:
    1.013
    Симпатии:
    174
    На скриншоте содержимое папки system и содержимое файла для этой папки правильное.
    А вот что с .htaccess в корневой папке не ясно. Возможно, он всё ещё с txt или вовсе отсутствует.
     
  10. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
    ой.. :(
     
  11. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    Высылаю скрин,я правильно понимаю, что это корень и .htaccess у меня нет?
    Мне его самой надо сделать, в блокноте?Перенести минимальную конфигурацию htaccess, что выше? Разместить в этой после config.php?




    upload_2019-10-7_19-43-51.png
     
  12. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
  13. SiteMix

    SiteMix Продвинутый пользователь

    Сообщения:
    1.013
    Симпатии:
    174
    Можно просто скопировать из дистрибутива. Только нужно добавить редирект www и http (по необходимости).
     
  14. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    Скопировала из дистрибутива. При этом и в корне и в system содержание дока .htaccess стало одинаковым.
    Ничего не изменилось.Ошибка 404 так и осталась
    Правда редирект не добавила. Подскажите,пожалуйста, как это сделать. И еще я работаю с дефолтным шаблоном. Может, из -за этого ошибка вылезает?

    upload_2019-10-8_21-26-30.png
    upload_2019-10-8_21-29-46.png

    полный текст .htaccess сейчас такой

    # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

    # 2. In your opencart directory rename htaccess.txt to .htaccess.

    # For any support issues please visit: http://www.opencart.com

    Options +FollowSymlinks

    # Prevent Directoy listing
    Options -Indexes

    # Prevent Direct Access to files
    <FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
    Require all denied
    ## For apache 2.2 and older, replace "Require all denied" with these two lines :
    # Order deny,allow
    # Deny from all
    </FilesMatch>

    # SEO URL Settings
    RewriteEngine On
    # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

    RewriteBase /
    RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
    RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

    ### Additional Settings that may need to be enabled for some servers
    ### Uncomment the commands by removing the # sign in front of it.
    ### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

    # 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
    # php_flag register_globals off

    # 2. If your cart has magic quotes enabled, This may work to disable it:
    # php_flag magic_quotes_gpc Off

    # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
    # php_value upload_max_filesize 999M

    # 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value post_max_size 999M

    # 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value max_execution_time 200

    # 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value max_input_time 200

    # 7. disable open_basedir limitations
    # php_admin_value open_basedir none
     
  15. Ravilr

    Ravilr Специалист

    Сообщения:
    3.864
    Симпатии:
    1.059
    При htaccess и коробки, 404 ошибки быть не должно. Возможно у вас уже все нормально, просто браузер закешировал правила. Проверить не могу, сат у вас на обслуживании.
     
  16. SiteMix

    SiteMix Продвинутый пользователь

    Сообщения:
    1.013
    Симпатии:
    174
    Это неправильно. В system должно быть содержание как в третьем сообщении.

    Может потребоваться очиска системного кэша: system/storage/cache/, кроме файла index.html
    Если папка storage переносилась, то очищать там.
     
  17. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    т.е. в папке .htaccess корня и папке .htaccess system должно быть разное содержимое?

    Прчитала на форуме, что надо дополнить здесь, т..к у меня дефолтный макет, то прописывать его
    RewriteBase/BRB/Default/
    но вот то, что красным тоже надо пописать?

    Папку storage не переносила, Где лучше глянуть алгоритм, как провести системную ошибку в опенкарт 3?
     
  18. ЕленаЧ

    ЕленаЧ Пользователь

    Сообщения:
    33
    Симпатии:
    0
    Спасибо всем, кто помогал. Проблема была в одной строке .htaccess, которая почему-то вылезала в другой кодировке. Поправила в файловом менеджере, все заработало.
     
  19. ozersk

    ozersk Новичок

    Сообщения:
    3
    Симпатии:
    1
    Аналогичная проблема. Чпу включен, .htaccess переименован и лежит в корне.Все разделы 404
    помогите пожалуйста разобраться.
    # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

    # 2. In your opencart directory rename htaccess.txt to .htaccess.

    # For any support issues please visit: http://www.opencart.com

    Options +FollowSymlinks

    # Prevent Directoy listing
    Options -Indexes

    # Prevent Direct Access to files
    <FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
    Require all denied
    ## For apache 2.2 and older, replace "Require all denied" with these two lines :
    # Order deny,allow
    # Deny from all
    </FilesMatch>

    # SEO URL Settings
    RewriteEngine On
    # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

    RewriteBase /
    RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
    RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

    ### Additional Settings that may need to be enabled for some servers
    ### Uncomment the commands by removing the # sign in front of it.
    ### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

    # 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
    # php_flag register_globals off

    # 2. If your cart has magic quotes enabled, This may work to disable it:
    # php_flag magic_quotes_gpc Off

    # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
    # php_value upload_max_filesize 999M

    # 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value post_max_size 999M

    # 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value max_execution_time 200

    # 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
    # php_value max_input_time 200

    # 7. disable open_basedir limitations
    # php_admin_value open_basedir none
     
    Последнее редактирование: 15 авг 2020
  20. Chukcha

    Chukcha Специалист

    Сообщения:
    3.013
    Симпатии:
    685
    Если у вас чистый ngnix
    то нужно править конфиг ngnix