Смешанный контент на поддомене - как заменить мета-ссылки http на https

У меня есть веб-сайт PHP, и я работаю над демонстрационным поддоменом, social.searchika.com, где я получаю смешанный контент по HTTPS. Основной домен не имеет проблем и работает нормально. Проблема только на поддомене.

Это код в моем config.php:

// MySQL Hostname
$sql_db_host = "localhost";
// MySQL Database User
$sql_db_user = "root";
// MySQL Database Password
$sql_db_pass = "";
// MySQL Database Name
$sql_db_name = "deepak_social";

// Site URL
$site_url = "http://social.searchika.com"; // e.g http://example.com

Он загружается со смешанным контентом (HTTPS и HTTP URL)

Когда я помещаю HTTPS в URL-адрес, я получаю следующую ошибку:

Эта страница не работает. Social.searchika.com слишком много раз перенаправлял вас.

Вот что у меня есть в моем индексном файле:

if ($wo['loggedin'] == true) {
  $update_last_seen = Wo_LastSeen($wo['user']['user_id']);
} else if (!empty($_SERVER['HTTP_HOST'])) {
  $server_scheme = @$_SERVER["HTTPS"];
  $pageURL = ($server_scheme == "on") ? "https://" : "http://";
  $http_url = $pageURL . $_SERVER['HTTP_HOST'];
  $url = parse_url($wo['config']['site_url']);
  if (!empty($url)) {
    if ($url['scheme'] == 'http') {
      if ($http_url != 'http://' . $url['host']) { 
        header('Location: ' . $wo['config']['site_url']);
        exit();
      }
    } else {
      if ($http_url != 'https://' . $url['host']) { 
        header('Location: ' . $wo['config']['site_url']);
        exit();
    }
  }

}

nginx.conf выглядит так

# nginx configuration

location / {
  if (!-e $request_filename){
    rewrite ^/password-reset/([^/]+)(/|)$ /index.php?link1=welcome&link2=password_reset&user_id=$1;
  }
  rewrite ^/$ /index.php?link1=home;
  rewrite "^/forum/members/([a-zA-Z]{0,1})(/?|)$" /index.php?link1=forum-members-byname&char=$1;
  if (!-e $request_filename){
    rewrite ^/setting/([A-Za-z0-9_]+)/([A-Za-z0-9_-]+)$ /index.php?link1=setting&user=$1&page=$2;
    rewrite ^/setting/([A-Za-z0-9_-]+)$ /index.php?link1=setting&page=$1;
    rewrite ^/setting$ /index.php?link1=setting;
  }
  if (!-e $request_filename){
    rewrite ^/@([^/]+)(/|)$ /index.php?link1=timeline&u=$1;
  }
  if (!-e $request_filename){
    rewrite ^/([A-Za-z0-9_]+)/([^/]+)(/|)$ /index.php?link1=timeline&u=$1&type=$2;
  }
  if (!-e $request_filename){
    rewrite ^/([^/]+)(/|)$ /index.php?link1=timeline&u=$1;
  }
}

location /admin {
  rewrite ^/admin-cp$ /admincp.php;
  rewrite ^/admin-cp/(.*)$ /admincp.php?page=$1;
  rewrite ^/admin/ads/edit/(\d+)(/?|)$ /index.php?link1=manage-ads&id=$1;
}

location = /admincp {
  rewrite ^(.*)$ /admincp.php;
}

location /admincp {
  rewrite ^/admincp/(.*)$ /admincp.php?page=$1;
}

location /adminPages/ {
  return 301 /admin-panel/;
}

location ~ ^/adminPages/(.*) {
    return 301 /admin-panel/$1;
}

location /start {
  rewrite ^/start-up$ /index.php?link1=start-up;
}

location /saved {
  rewrite ^/saved-posts/(.*)$ /index.php?link1=saved-posts;
  rewrite ^/saved-posts$ /index.php?link1=saved-posts;
}

location /activated {
  rewrite ^/activated/(.*)$ /index.php?link1=activate&link2=$1;
}

location = /search {
  rewrite ^(.*)$ /index.php?link1=search;
}

location /ads {
  rewrite ^/ads-create$ /index.php?link1=ads-create;
  rewrite ^/ads(/?|)$ /index.php?link1=ads;
  rewrite ^/ads/create(/?|)$ /index.php?link1=create-ads;
  rewrite ^/ads/edit/(\d+)(/?|)$ /index.php?link1=edit-ads&id=$1;
  rewrite ^/ads/chart/(\d+)(/?|)$ /index.php?link1=chart-ads&id=$1;
}

location /send_money {
  rewrite ^/send_money$ /index.php?link1=ads-create;
}

location = /most_liked {
  rewrite ^(.*)$ /index.php?link1=most_liked;
}

location /suggested {
  rewrite ^/suggested-pages(/?|)$ /index.php?link1=suggested-pages;
  rewrite ^/suggested-groups(/?|)$ /index.php?link1=suggested-groups;
}

location = /poke {
  rewrite ^(.*)$ /index.php?link1=poke;
}

location /search {
  rewrite ^/search/([^/]+)(/|)$ /index.php?link1=search&query=$1;
}

location /app {
  rewrite ^/app/([^/]+)(/|)$ /index.php?link1=app&app_id=$1;
}

location /messages {
  rewrite ^/messages/([^/]+)(/|)$ /index.php?link1=messages&user=$1;
}

location /terms {
  rewrite ^/terms/([^/]+)(/|)$ /index.php?link1=terms&type=$1;
}

location /video {
  rewrite ^/video-call/([^/]+)(/|)$ /index.php?link1=video-call&call_id=$1;
  rewrite ^/video-call-api/([^/]+)(/|)$ /index.php?link1=video-call-api&call_id=$1;
}

location /post {
  rewrite ^/post/([^/]+)(/|)$ /index.php?link1=post&id=$1;
}

location /game {
  rewrite ^/game/([^/]+)(/|)$ /index.php?link1=game&id=$1;
}

location = /upgraded {
  rewrite ^(.*)$ /index.php?link1=upgraded;
}

location = /get_news_feed {
  rewrite ^(.*)$ /index.php?link1=get_news_feed;
}

location = /games {
  rewrite ^(.*)$ /index.php?link1=games;
}

location /new {
  rewrite ^/new-game$ /index.php?link1=new-game;
  rewrite ^/new-product$ /index.php?link1=new-product;
}

location /go {
  rewrite ^/go-pro$ /index.php?link1=go-pro;
}

location = /oops {
  rewrite ^(.*)$ /index.php?link1=oops;
}

location /user {
  rewrite ^/user-activation$ /index.php?link1=user-activation;
}

location /hashtag {
  rewrite ^/hashtag/([^/]+)(/|)$ /index.php?link1=hashtag&hash=$1;
}

location /follow {
  rewrite ^/follow-requests/(.*)$ /index.php?link1=follow-requests;
}

location = /home {
  rewrite ^(.*)$ /index.php?link1=home;
}

location = /404 {
  rewrite ^(.*)$ /index.php?link1=404;
}

location /welcome {
  rewrite ^/welcome(.*)$ /index.php?link1=welcome;
}

location = /register {
  rewrite ^(.*)$ /index.php?link1=register;
}

location /confirm {
  rewrite ^/confirm-sms$ /index.php?link1=confirm-sms;
  rewrite ^/confirm-sms-password(/?|)$ /index.php?link1=confirm-sms-password break;
}

location /forgot {
  rewrite ^/forgot-password$ /index.php?link1=forgot-password;
}

location = /activate {
  rewrite ^(.*)$ /index.php?link1=activate;
}

location = /pages {
  rewrite ^(.*)$ /index.php?link1=pages;
}

location = /groups {
  rewrite ^(.*)$ /index.php?link1=groups;
}

location /create {
  rewrite ^/create-group$ /index.php?link1=create-group;
  rewrite ^/create-page$ /index.php?link1=create-page;
  rewrite ^/create-album$ /index.php?link1=create-album;
  rewrite ^/create-album/([A-Za-z0-9_-]+)$ /index.php?link1=create-album&album=$1;
  rewrite ^/create-blog(/?|)$ /index.php?link1=create-blog;
  rewrite ^/create-app$ /index.php?link1=create-app;
}

location = /logout {
  rewrite ^(.*)$ /index.php?link1=logout;
}

location /contact {
  rewrite ^/contact-us$ /index.php?link1=contact-us;
}

location = /messages {
  rewrite ^(.*)$ /index.php?link1=messages;
}

location = /albums {
  rewrite ^(.*)$ /index.php?link1=albums;
}

location /albums {
  rewrite ^/albums/([A-Za-z0-9_-]+)$ /index.php?link1=albums&user=$1;
}

location /album {
  rewrite ^/album/([A-Za-z0-9_-]+)$ /index.php?link1=album&id=$1;
}

location /page {
  rewrite ^/page-setting/([^/]+)(/|)$ /index.php?link1=page-setting&page=$1;
  rewrite ^/page-setting/([A-Za-z0-9_]+)/([A-Za-z0-9_-]+)$ /index.php?link1=page-setting&page=$1&link3=$2;
}

location /group {
  rewrite ^/group-setting/([^/]+)(/|)$ /index.php?link1=group-setting&group=$1;
  rewrite ^/group-setting/([A-Za-z0-9_]+)/([A-Za-z0-9_-]+)$ /index.php?link1=group-setting&group=$1&link3=$2;
}

location /edit {
  rewrite ^/edit-product/([A-Za-z0-9_]+)$ /index.php?link1=edit-product&id=$1;
  rewrite ^/edit-blog/(\d+)(/?|)$ /index.php?link1=edit-blog&id=$1;
}

location = /products {
  rewrite ^(.*)$ /index.php?link1=products;
}

location /products {
  rewrite ^/products/([A-Za-z0-9_-]+)$ /index.php?link1=products&c_id=$1;
}

location /my {
  rewrite ^/my-products$ /index.php?link1=my-products;
  rewrite ^/my-blogs(/?|)$ /index.php?link1=my-blogs;
}

location /site {
  rewrite ^/site-pages/(.*)$ /index.php?link1=site-pages&page_name=$1;
}

location = /blogs {
  rewrite ^(.*)$ /index.php?link1=blogs;
}

location = /sharer {
  rewrite ^(.*)$ /index.php?link1=sharer;
}

location /blog {
  rewrite ^/blog-category/(\d+)(/?|)$ /index.php?link1=blog-category&id=$1;
}

location /read {
  rewrite ^/read-blog/(.*)$ /index.php?link1=read-blog&id=$1;
}

location = /app_api {
  rewrite ^(.*)$ /index.php?link1=app_api;
}

location /api {
  rewrite ^/api(/?|)$ /api-v2.php;
  rewrite ^/api/([^/]+)(/|)$ /api-v2.php?type=$1;
}

location = /authorize {
  rewrite ^(.*)$ /index.php?link1=authorize;
}

location /forum {
  rewrite ^/forum(/?|)$ /index.php?link1=forum;
  rewrite ^/forum/members(/?|)$ /index.php?link1=forum-members;
  rewrite ^/forum/search(/?|)$ /index.php?link1=forum-search;
  rewrite ^/forum/search-result/(/?|)$ /index.php?link1=forum-search-result;
  rewrite ^/forum/events(/?|)$ /index.php?link1=forum-events;
  rewrite ^/forum/help(/?|)$ /index.php?link1=forum-help;
}

location /forums {
  rewrite ^/forums/(\d+)(/?|)$ /index.php?link1=forums&fid=$1;
  rewrite ^/forums/add/(\d+)(/?|)$ /index.php?link1=forumaddthred&fid=$1;
  rewrite ^/forums/thread/(\d+)(/?|)$ /index.php?link1=showthread&tid=$1;
  rewrite ^/forums/thread/reply/(\d+)(/?|)$ /index.php?link1=threadreply&tid=$1;
  rewrite ^/forums/thread/quote/(\d+)(/?|)$ /index.php?link1=threadquote&tid=$1;
  rewrite ^/forums/thread/edit/(\d+)(/?|)$ /index.php?link1=editreply&tid=$1;
  rewrite ^/forums/user/threads(/?|)$ /index.php?link1=mythreads;
  rewrite ^/forums/user/threads/edit/(\d+)(/?|)$ /index.php?link1=edithread&tid=$1;
  rewrite ^/forums/user/messages(/?|)$ /index.php?link1=mymessages;
}

location /events {
  rewrite ^/events(/?|)$ /index.php?link1=events;
  rewrite ^/events/create-event(/?|)$ /index.php?link1=create-event;
  rewrite ^/events/edit/(\d+)/(/?|)$ /index.php?link1=edit-event&eid=$1;
  rewrite ^/events/my(/?|)$ /index.php?link1=my-events;
  rewrite ^/events/going(/?|)$ /index.php?link1=events-going;
  rewrite ^/events/invited(/?|)$ /index.php?link1=events-invited;
  rewrite ^/events/interested(/?|)$ /index.php?link1=events-interested;
  rewrite ^/events/past(/?|)$ /index.php?link1=events-past;
  rewrite ^/events/(\d+)(/?|)$ /index.php?link1=show-event&eid=$1;
}

location /movies {
  rewrite ^/movies(/?|)$ /index.php?link1=movies;
  rewrite ^/movies/genre/([A-Za-z-]+)(/?|)$ /index.php?link1=movies-genre&genre=$1;
  rewrite ^/movies/country/([A-Za-z-]+)(/?|)$ /index.php?link1=movies-country&country=$1;
  rewrite ^/movies/watch/(\d+)(/?|)$ /index.php?link1=watch-film&film-id=$1;
}

location /wallet {
  rewrite ^/wallet(/?|)$ /index.php?link1=wallet;
}

location /status {
  rewrite ^/status/create(/?|)$ /index.php?link1=create-status;
}

location /more {
  rewrite ^/more-status(/?|)$ /index.php?link1=more-status;
}

location /friends {
  rewrite ^/friends-nearby(/?|)$ /index.php?link1=friends-nearby;
}

location /_ {
  rewrite ^/_$ /requests.php;
}

location /graph {
  rewrite ^/graph-success$ /index.php?link1=graph-success;
}

location = /developers {
  rewrite ^(.*)$ /index.php?link1=developers;
}

location = /apps {
  rewrite ^(.*)$ /index.php?link1=apps;
}

location = /graph {
  rewrite ^(.*)$ /index.php?link1=graph;
}

location = /oauth {
  rewrite ^(.*)$ /index.php?link1=oauth;
}

location /boosted {
  rewrite ^/boosted-pages$ /index.php?link1=boosted-pages;
  rewrite ^/boosted-posts$ /index.php?link1=boosted-posts;
}

Я также сталкиваюсь с множеством проблем с log-n;

Самое простое решение, которое я могу найти, - просто заменить URL-адреса версией https, потому что ссылки, которые создают проблему, являются только метатегами, но даже я не могу найти исходный код для всех метатегов в моем файле. Пожалуйста, посоветуйте.Спасибо. !

Не могли бы вы добавить свою конфигурацию apache2 или nginx к вопросу выше (с помощью кнопки редактирования), потому что в комментариях трудно читать код. MySql здесь не проблема.

digijay 28.12.2018 10:17

Спасибо за ваш ответ. nginx.conf и config.php обновлены в вопросе

Sonu Singh 28.12.2018 10:34
Стоит ли изучать PHP в 2026-2027 годах?
Стоит ли изучать PHP в 2026-2027 годах?
Привет всем, сегодня я хочу высказать свои соображения по поводу вопроса, который я уже много раз получал в своем сообществе: "Стоит ли изучать PHP в...
Symfony Station Communiqué - 7 июля 2023 г
Symfony Station Communiqué - 7 июля 2023 г
Это коммюнике первоначально появилось на Symfony Station .
Оживление вашего приложения Laravel: Понимание режима обслуживания
Оживление вашего приложения Laravel: Понимание режима обслуживания
Здравствуйте, разработчики! В сегодняшней статье мы рассмотрим важный аспект управления приложениями, который часто упускается из виду в суете...
Установка и настройка Nginx и PHP на Ubuntu-сервере
Установка и настройка Nginx и PHP на Ubuntu-сервере
В этот раз я сделаю руководство по установке и настройке nginx и php на Ubuntu OS.
Коллекции в Laravel более простым способом
Коллекции в Laravel более простым способом
Привет, читатели, сегодня мы узнаем о коллекциях. В Laravel коллекции - это способ манипулировать массивами и играть с массивами данных. Благодаря...
Как установить PHP на Mac
Как установить PHP на Mac
PHP - это популярный язык программирования, который используется для разработки веб-приложений. Если вы используете Mac и хотите разрабатывать...
0
2
54
0

Другие вопросы по теме