How to enforce Web Presence Builder to generate https links in sitemap?

Created:

2016-11-16 12:49:57 UTC

Modified:

2017-04-24 11:20:13 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enforce Web Presence Builder to generate https links in sitemap?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Question

Is it possible to enforce Web Presence Builder (WPB) to generate links like https://example.com in sitemap?

Answer

Note: WPB takes URL value from the site_publish_settings table while generating sitemap.xml . If WPB was installed with Plesk, this setting is updated each time a site is opened in the Editor. And, looking into its source code , http:// is hardcoded there to precede the URL, irrespective of the hosting settings:

 protected function _getDomainUrl($siteUuid)
{
[skiped]
return 'http://' . $hosting->getDomainName() . '/';
}

It makes sense to do the described below after all the changes are made to the site.

Update website publication settings in database:

  1. Back up ' sitebuilder5 ' database:

    # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` sitebuilder5 > sitebuilder5.`date +%F_%H:%M`.sql
  2. Log on to the database and get the current site publication settings:

    # plesk db
    > use sitebuilder5;
    > select * from site_publish_settings where url like '%domain%'\\G
    *************************** 1. row ***************************
    id: 1
    host_id: NULL
    uuid: 0cdeb8a8-d9f2-9fca-3304-2d539e9c1bab
    target_url: pp://1f23954f-e9b3-1ff0-ed7a-9ff398386c95
    fallback_ip: NULL
    url: http://example.com/
    is_mysql_used: 0
    mysql_host: NULL
    mysql_port: NULL
    mysql_user: NULL
    mysql_password: NULL
    mysql_database: NULL
    http_user: NULL
    http_password: NULL
    ftp_mode: NULL
    1 row in set (0.00 sec)
  3. Update the site publication settings:

    > update site_publish_settings set url='https://example.com/' where id=1;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
  4. Publish the website to generate a new sitemap.xml

For Plesk 12.5 and higher: It can be worked around by enabling option Permanent SEO-safe 301 redirect from HTTP to HTTPS in Subscription > example.com > Hosting Settings .

123.png

Have more questions? Submit a request
Please sign in to leave a comment.