Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...

Убрать слеши в конце урлов


 Поделиться

Рекомендованные сообщения

Помогите, пожалуйста. 

 

На сайте часть страниц со слешами в конце страниц, часть без. Наобходимо избавиться от слешей во всех урлах. После вставки в .htaccess директивы 

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [R=301,L]

страницы со слешами перестали открываться, при этом при перезагрузке страницы слеш периодически появляется-пропадает.

 

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 +SymLinksIfOwnerMatch

# 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/

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [R=301,L]

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/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]

### 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

Redirect 301 /categories/aromaterapiya /index.php?route=common/home
# Redirect 301 /about.html /index.php?route=information/information&information_id=3644
# Redirect 301 /contact.html /index.php?route=information/contact
Redirect 301 /dostavka/oplata.html /index.php?route=information/information&information_id=3645

<IF "false">
# Redirect 301 /katalog-tovarov/semena/ /index.php?route=product/category&path=86
# Redirect 301 /katalog-tovarov/semena/kapusta-krasnokachannaya/ /index.php?route=product/category&path=86_182
# Redirect 301 /katalog-tovarov/semena/luk/ /index.php?route=product/category&path=86_154
# Redirect 301 /katalog-tovarov/semena/zelen/ /index.php?route=product/category&path=86_192
# Redirect 301 /katalog-tovarov/semena/pomidoryi/tomat-ekzotika/ /index.php?route=product/category&path=86_139_218
# Redirect 301 /katalog-tovarov/semena/pomidoryi/ /index.php?route=product/category&path=86_139
# Redirect 301 /katalog-tovarov/semena/baklazhan/ /index.php?route=product/category&path=86_149
# Redirect 301 /katalog-tovarov/semena/tyikva/ /index.php?route=product/category&path=86_191
# Redirect 301 /katalog-tovarov/semena/gazonnyie-travyi/ /index.php?route=product/category&path=86_806
# Redirect 301 /katalog-tovarov/semena/kapusta-brokkoli/ /index.php?route=product/category&path=86_312
# Redirect 301 /katalog-tovarov/semena/arbuzyi/ /index.php?route=product/category&path=86_87
# Redirect 301 /katalog-tovarov/semena/kapusta-pekinskaya/ /index.php?route=product/category&path=86_187
# Redirect 301 /katalog-tovarov/semena/kapusta/rannij-sort/ /index.php?route=product/category&path=86_150_165
# Redirect 301 /katalog-tovarov/semena/salat/ /katalog-tovarov/semena/salat/
# Redirect 301 /katalog-tovarov/semena/shpinat/ /index.php?route=product/category&path=86_1098
# Redirect 301 /katalog-tovarov/semena/svekla-kormovaya/ /index.php?route=product/category&path=86_180
# Redirect 301 /katalog-tovarov/semena/kapusta/ /index.php?route=product/category&path=86_150
# Redirect 301 /katalog-tovarov/semena/dyinya/ /index.php?route=product/category&path=86_151
# Redirect 301 /katalog-tovarov/semena/fasol/ /index.php?route=product/category&path=86_514
# Redirect 301 /katalog-tovarov/semena/kabachok/ /index.php?route=product/category&path=86_152
# Redirect 301 /katalog-tovarov/semena/morkov/ /index.php?route=product/category&path=86_155
# Redirect 301 /katalog-tovarov/semena/pomidoryi/rannie/abelus-f1-abellus-f1.html /index.php?route=product/product&path=86_139_145&product_id=4142
# Redirect 301 /katalog-tovarov/semena/luk/luk-porej/forrest-forrest.html /index.php?route=product/product&path=86_154_349&product_id=350
# Redirect 301 /katalog-tovarov/semena/gorox-ovoshhnoj/ /index.php?route=product/category&path=86_196
# Redirect 301 /katalog-tovarov/semena/kapusta-krasnokachannaya/ /index.php?route=product/category&path=86_182
# Redirect 301 /katalog-tovarov/semena/svekla-stolovaya/ /index.php?route=product/category&path=86_176
# Redirect 301 /katalog-tovarov/semena/selderej/ /index.php?route=product/category&path=86_382
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/insekticzidyi/ /index.php?route=product/category&path=96_2371
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/insekticzidyi/aplaud.html /index.php?route=product/product&path=96_2371&product_id=3242
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/insekticzidyi/aktara-25-wg-v.g/ /index.php?route=product/product&path=96_2371&product_id=2372
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/gerbiczidyi/ /index.php?route=product/category&path=96_2368
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/gerbiczidyi/betanal-maks-pro.html /index.php?route=product/product&path=96_2368&product_id=3289
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/gerbiczidyi/stomp-basf.html /index.php?route=product/product&path=96_2368&product_id=2693
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/gerbiczidyi/astera.html /index.php?route=product/product&path=96_2368&product_id=3287
# Redirect 301 /katalog-tovarov/sredstva-zashhityi/fungiczidyi/ /index.php?route=product/category&path=96_2369
# Redirect 301 /katalog-tovarov/udobreniya/ /index.php?route=product/category&path=121
# Redirect 301 /katalog-tovarov/melkaya-fasovka-semyan/semena-redisa/tetra-iloveczka-tetra-ilovecka.html /index.php?route=product/product&path=4148_4584&product_id=5566
# Redirect 301 /kassetyi-dlya-rassadyi/ /index.php?route=product/category&path=2300
</IF>

### Display PHP errors 
### Uncomment the commands by removing the # sign in front of it.
# php_flag display_startup_errors on
# php_flag display_errors on
# php_flag html_errors on
# php_flag track_errors on
# php_value error_reporting "E_ALL"
 

Ссылка на комментарий
Поделиться на других сайтах


7 минут назад, aromantsov сказал:

SeoPro включен

Тогда  в товарах, категориях и инфостраницах должны быть слешы, а на технических, вроде личного кабинета, нет. Если работает не как на демо, значит что-то накрутили

Изменено пользователем wbDev
Ссылка на комментарий
Поделиться на других сайтах


3 хвилини назад, wbDev сказав:

Тогда  в товарах, категориях и инфостраницах должны быть слешы, а на технических, вроде личного кабинета, нет. Если работает не как на демо, значит что-то накрутили

Все работает примерно так, как на демо. Но, мне необходимо отсутствие слеша на всех страницах, включая каатегории и инфостраницы

Ссылка на комментарий
Поделиться на других сайтах


2 минуты назад, aromantsov сказал:

Все работает примерно так, как на демо. Но, мне необходимо отсутствие слеша на всех страницах, включая каатегории и инфостраницы

В файле seo_pro.php

$seo_url .= '/'; на $seo_url .= '';

 

Ссылка на комментарий
Поделиться на других сайтах


5 минут назад, aromantsov сказал:

Это уже исправлено - не помогает

case 'path':
						$categories = explode('_', $value);
						foreach ($categories as $category) {
							$queries[] = 'category_id=' . $category;
						}
						unset($data[$key]);
						break;

					default:
						break;

заменить на

case 'path':
						$categories = explode('_', $value);
						foreach ($categories as $category) {
							$queries[] = 'category_id=' . $category;
						}
						unset($data[$key]);
						$postfix = 1;
						break;

					default:

Кеш очистите, это чтобы в категориях не было. А технические страницы вообще надо закрыть от индекесации, а не слешики в них убирать

Ссылка на комментарий
Поделиться на других сайтах


Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас
 Поделиться

  • Сейчас на странице   0 пользователей

    • Нет пользователей, просматривающих эту страницу.
×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обработка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфиденциальности.