Иконка ресурса

Использование HTTPS (SSL) соединения с помощью .htaccess и mod_rewrite для XenForo

Проверь, правильно ли установлен сертификат
 
  • Мне нравится
Реакции: Hope
Да мне этот тест много о чём сказал конечно
 
Добрый вечер.

Все настроил,подключил, но почему то не перенаправляет на https, хотя форум доступен на https, в настройках все прописал, не подскажите что делать ?
.htaccess такой :
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
RewriteEngine On

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ [R=301]
</IfModule>

проксирование ссылок и изображения - включил
 
  • Мне нравится
Реакции: Hope
Это правило должно быть в начале, сразу после RewriteEngine On, а не в конце.

не помогло ...

Если в конфиг добавить $_SERVER['HTTPS'] = 'on'; , то работает, а так, нет, отписался в поддержку, мож чем помогут.

--------------------------------------------------------------------------
Если удалить
# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
из .htaccess , то норм работает, это нормально ? ) За что это вообще отвечает ?

а нее, теперь чпу 404 показывает при переходе по ссылке

--------------------------------------------------------------------------------------------------------
Вот так работает ГУд

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) [R,L]

Это нормальное решение ?
 
HTTPS это всего лишь средсво безопасности с использованием 443 порта. Для обычного сайта нет смысла использовать и покупать сетификат. Если админ портала дружит с головой то и без сетификата устроит всё норм. Большинству сайтов и форумов этот сер и нах не нужен. Хотите повыёживатся с SSL and TSL то пожалуска. Но как я думаю незачем это всё
 
Но как я думаю незачем это всё
Google и прочие поисковые системы думают иначе - сайты понижают в выдаче.
Firefox с середины следующего года вообще не будет открывать сайты без SSL.
Но вам, конечно, виднее...
 
:D что у меня не правильно?
Код:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
RewriteEngine On

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
</IfModule>
 
:-D что у меня не правильно?
Код:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
RewriteEngine On

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
</IfModule>
А что не работает?
 
Gerol, не перенаправляет на https
 
Gerol, Добавил) везде появилось но только не на главной странице : D
 
А в config.php есть такое $_SERVER['HTTPS'] = 'on'; ?
Вот эту какашку добавлять не рекомендовано, настраивается все без нее.

Gerol, Добавил) везде появилось но только не на главной странице : D
а теперь уберите !
и поменяйте концовку на
Код:
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default


<IfModule mod_rewrite.c>
    RewriteEngine On
   
    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-proto} !^https$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

И не забудте поменять в /admin.php?options/list/basicBoard везде http на https
 
niko22, в итоге была цыклическая переадрисация! Вот так сделал и вроде все заработало!
Вообще не пойму как работает, если даже не установлено там ничего!!!
Код:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
RewriteEngine On

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
Решил сделать https но с исключением на вкладке стримов.
Вышло так:

Код:
RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !=/streams/*
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

Но как ни странно исключение не работает, и по адресу /streams/* все так же идет https а не http
 
iDarkEmpire, какое-то странно "отключение". У вас третья строка все переназначает.
 
Это.. А тем временем Let's encrypt запустили.. никаких более платных сертификатов! :-)

P.S. Площадка для тестов моего товарища: (для желающих посмотреть данные сертификата)

А вот результаты теста, один мелкий недочет со стороны сервера, после автоматической процедуры генерации и установки сертификата.
2015-12-22 08-12-49.png

Выглядит не плохо.
 
Последнее редактирование:
  • Мне нравится
Реакции: Hope
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу