Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Как должен выглядеть .htaccess в IPS 4.4.10

Featured Replies

Posted

Друзья я новичек в IPS 4.4 и много не знаю, поэтому мои вопросы могут быть простыми )))
Установил  форум на хостинг и начал его настраивать. Мой хостинг дает SLL сертификат и я решил сразу перейти с http на https.  начал гуглить как это сделать и оказывается у меня нет файла htaccess в корне сайта.  Каким он должен быть и что там должно быть вписано ?

У меня так
 

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC]
RewriteRule ^(.*)$ - [F]
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
ErrorDocument 403 /index.htm

deny from 118.174.225.255

 

index.htm - это страничку которую видит забаненый через htaccess, можно любую другую сделать и прописать, я сделал чтоб спамеров в заблуждение вводить :)
Последняя строка - это ip забаненого

  • Author

Сделал файл как у вас и в итоге сайт не работает. Выдает ошибку 500

Обратился в тех поддержку хостинга и мне ответили, что функция MultiVievs не поддерживается.

Убрал строчку и сайт снова заработал. В итоге мой файл выглядит вот так:


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

35 минут назад, bsnet сказал:

Options -MultiViews

 

 

Снимок1.PNG

  • Author
3 часа назад, Desti сказал:

RewriteEngine On
RewriteCond %{HTTP:PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Можно так попробовать.

Когда ввожу вот это у меня возникает циклическая переадресация и сайт не работает

У меня так установлено

Спойлер

## IPS Suite Forum SEO
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) - [L,NC,R=404]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

## End IPS Suite Forum SEO

## Begin - Expires caching
<IfModule mod_expires.c>

## This rule will create an ETag for files based only on the modification timestamp and their size. 
## Note: It may cause problems on your server and you may need to remove it
FileETag MTime Size

SetOutputFilter DEFLATE
Header set Expires "max-age=29030400, public"
Header unset ETag
FileETag None

# Enable expiration control
ExpiresActive On

# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"

# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"

# Image files expiration: 1 month after request
ExpiresByType image/bmp "now plus 1 month" 
ExpiresByType image/gif "now plus 1 month"
ExpiresByType image/jpg "now plus 1 month"
ExpiresByType image/jpeg "now plus 1 month"
ExpiresByType image/jp2 "now plus 1 month"
ExpiresByType image/pipeg "now plus 1 month"
ExpiresByType image/png "now plus 1 month"
ExpiresByType image/svg+xml "now plus 1 month"
ExpiresByType image/tiff "now plus 1 month"
ExpiresByType image/vnd.microsoft.icon "now plus 1 month"
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/ico "now plus 1 month"
ExpiresByType image/icon "now plus 1 month"
ExpiresByType text/ico "now plus 1 month"
ExpiresByType application/ico "now plus 1 month"
ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
ExpiresByType application/vnd.wap.wbxml "now plus 1 month"

# Other optimizations
ExpiresByType application/x-gzip "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"

</IfModule>
## End - Expires caching

 

  • Author
В 28.02.2020 в 14:49, Desti сказал:

Проверяется, идет ли обращение к 443 порту и если нет, переадрессация на https.

понял. Спасибо.
У меня прописано вот это. Можете подсказать, что это значит ?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

RewriteCond - проверка какого-то условия для следующей за ней директивой RewriteRule.  Таким образом у вас два блока, 

RewriteCond %{REQUEST_FILENAME} !-f - если файл не существует
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L] и файл в запросе с указанным расширением, выдать ошибку 404. 

и 

RewriteCond %{REQUEST_FILENAME} !-f если файл из запроса не существует
RewriteCond %{REQUEST_FILENAME} !-d и папка из запроса не существует
RewriteRule . /index.php [L] переадрессация на index.php.

Затычки, в общем, от мамкиных хакеров и неверных ссылок на картинки.

  • Author
В 29.02.2020 в 19:43, Desti сказал:

RewriteCond - проверка какого-то условия для следующей за ней директивой RewriteRule.  Таким образом у вас два блока, 

RewriteCond %{REQUEST_FILENAME} !-f - если файл не существует
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L] и файл в запросе с указанным расширением, выдать ошибку 404. 

и 

RewriteCond %{REQUEST_FILENAME} !-f если файл из запроса не существует
RewriteCond %{REQUEST_FILENAME} !-d и папка из запроса не существует
RewriteRule . /index.php [L] переадрессация на index.php.

Затычки, в общем, от мамкиных хакеров и неверных ссылок на картинки.

Спасибо за подробное пояснение ! 
Тогда так и оставлю )

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.