Новости Joomla

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

Deska

  • Новичок
  • 7
  • 0 / 0
Добрый день!

Помогите мне пожалуйста.
Есть у меня сайт  medical-cabinet.ru

Задалась я целью убрать дубли страниц, либо сделать все со слешами на конце либо без.
На данный момент рассмотрим ситуацию со слешами на конце.
Все успешно получилось. НО... возникли другие проблемы.

1. Перестал работать поиск с любых страниц кроме главной.

Прикладываю htaccess

Вообще он у меня был больше, это так сказать рабочая версия без всяких сжатий и прочего с целью убрать дубли и ничего не сломать.


RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8

#делаем исключение для поиска чтоб он таки работал
RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru/$1/$
RewriteCond %{REQUEST_URI} (component/search/?searchword.*)$
RewriteRule ^(.*[^/])$ $1 [L,R=301]

# добавить завершающий слеш, писать L нельзя иначе до правила с поиском не дойдем
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_URI} ! (/component/search/.*)/$
#RewriteCond %{REQUEST_URI} ! (/administrator)/$
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]



# удалить заверщающий слеш
#RewriteCond %{HTTP_HOST} !(www.medical-cabinet.ru/administrator/)
#RewriteCond %{HTTP_HOST} (.*)
#RewriteCond %{REQUEST_URI} /$ [NC]
#RewriteRule ^(.*)(/)$ $1 [L,R=301]


#делаем исключение для поиска чтоб он таки работал
##RewriteCond %{REQUEST_URI} (component/search.*)/$
##RewriteRule ^(.*)(/)$ $1 [L,R=301]

RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru
RewriteRule (.*) http://medical-cabinet.ru/$1 [R=301,L]

#RewriteCond %{REQUEST_URI} (component/search.*)/$
#RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru/$1/$

#RewriteRule (.*) http://medical-cabinet.ru/$1 [R=301,L]

## 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/aicontactsafe|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
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.

# перенаправление для sitemap
RewriteRule ^sitemap\.xml$ http://medical-cabinet.ru/index.php?option=com_xmap&id=1&view=xml [R=301,L]

#сжатие CSS                    
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/css
    
    <IfModule mod_setenvif.c>
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </IfModule>
</IfModule>
*

Deska

  • Новичок
  • 7
  • 0 / 0
Проблему я решила.


I found a solution to this. I post this solution here in case somebody else needs it.

1. Go to Menu Manager and create a new Menu.
2. Create a new Menu Module and assign it to the Menu you have created. (Module Parameters>Menu Name). Keep this module NOT enabled.
3. Add a new menu item to your menu. Choose the Search menu Type for it. Save it.
4. After you have created the search menu type item, go to Menu Item's edit page and copy the Link.
5. Paste this Link into the file /httpdocs/modules/mod_search/tmpl/default.php

line 3, replace:
<form action="index.php" method="post">

with this

<form action="menu_item_copied_link" method="post">


It's working ok for me.
Не знаю насколь это правильное решение, но рабочее.
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Проблемы с мобильной версией

Автор gromlan

Ответов: 0
Просмотров: 812
Последний ответ 04.07.2018, 15:23:33
от gromlan
дубли страниц

Автор abonnent

Ответов: 3
Просмотров: 979
Последний ответ 12.10.2017, 14:15:13
от SeBun
Проблемы с кодировкой Joomshoping

Автор mary_NK

Ответов: 3
Просмотров: 1031
Последний ответ 06.06.2017, 10:19:14
от darkghost
Проблемы с формой GET

Автор Yan

Ответов: 1
Просмотров: 1396
Последний ответ 01.07.2016, 14:52:42
от saharin88
Как переименовать навигацию страниц в Joomla 2.5?

Автор Romanych

Ответов: 2
Просмотров: 1715
Последний ответ 27.05.2016, 15:24:09
от gromlan