make button (static / numbered) served via https

Discussion in 'General Help' started by PPNSteve, Oct 6, 2018.

  1. PPNSteve

    PPNSteve PPN Top 50

    currently hqave our VL and the button image dirs set to a https url but when button.php processes the link, it serves a http image (not the expected https).

    What can we do to get it to use https?

    example headers:

    upload_2018-10-6_8-55-44.png

    VL URL: https://www.ppntop50.com

    sample button link code:
    HTML:
    <a href="https://www.ppntop50.com/"><img src="https://www.ppntop50.com/button.php?u=2&amp;buttontype=rank" alt="PPN Top 50"></a>
    cajkan likes this.
  2. Basti
    • Staff

    Basti Administrator Staff Member

    Have a look in your admin settings. Looks like you didn't updated the button urls to https yet
    cajkan and Mark like this.
  3. PPNSteve

    PPNSteve PPN Top 50

    Pretty sure its using HTTPS

    upload_2018-10-21_14-54-4.png

    Attached Files:

  4. Basti
    • Staff

    Basti Administrator Staff Member

    Was the image in your first post already there when you posted it? How could I miss that? I get old....

    Have a close look at the request and response headers. Your member requested http, but got a 302 redirect for the image url to https.

    I see, he indeed use the button.php url, please post your button.php here to investigate

    P.s your site returns error 500 for me today
    Last edited: Oct 22, 2018
  5. PPNSteve

    PPNSteve PPN Top 50

    Hi,
    Yup sorry if i wasn't being clear.. the requests are definitely HTTPS however the actual button image is served via HTTP..
    code tag didn't allow post to process.. txt file attached..

    OK apparently switching the server over to PHP 7.x breaks the topsite script.. set domain back to php5

    Attached Files:

  6. Basti
    • Staff

    Basti Administrator Staff Member

    Did you modified button.php?

    I see some non default redirects which should not happen. e.g https://www.ppntop50.com/button.php?u=kazzy5 should normally not redirect to a rank button unless you have buttontype=rank in it
    This happens because of the last statement in here and a another
    PHP:
    if ($_GET['buttontype'] == 'rank' || $_GET['buttontype'] == 'stats' || !isset($_GET['buttontype'])) {
    Normally these members should get the default static button, not a rank one.
    This is not really related but pls update your button.php with the attached code and instead put the redirect into .htaccess if you need that functionality

    button.php is from vl 1.6 with some error fixes as well

    Any other custom stuff? button related plugins? custom htaccess code? redirects set in cpanel?

    It seems you have a https redirect in htaccess, is that correct? can you post that one?
    If you want you can also drop me ftp info so I can verify stuff easier and maybe test

    Attached Files:

    Last edited: Oct 30, 2018
  7. PPNSteve

    PPNSteve PPN Top 50

    ok, the updated button.php doesn't fix it..

    .htaccess does have https redirect:
    HTML:
    Options +FollowSymLinks
    
    RewriteEngine on
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ https://www.ppntop50.com/$1 [R,L]
    
    ################ Require ending trailing slash
    
    RewriteCond %{REQUEST_FILENAME} !-f
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    https://www.ppntop50.com/button.php?u=2&buttontype=rank directly returns a https image in the browser but not when in the a href button tag for whatever reason

    upload_2018-12-13_18-51-58.png

    upload_2018-12-13_18-50-35.png
  8. PPNSteve

    PPNSteve PPN Top 50

    just to show..

    PHP:
    <?php

    $CONF
    ['count_pv'] = 1//Count pageviews

    $CONF['text_link_button_alt'] = 'PPN Top 50'// Text Link Anchor, Alt for Buttons
    $CONF['text_link'] = 1//Enable Text Link
    $CONF['static_button'] = 0// Show Only Static Button
    $CONF['static_button_url'] = 'https://www.ppntop50.com/images/buttons/xmas/0.gif';

    $CONF['rank_button'] = 1//Show buttons with rank 1.gif, 2.gif etc
    $CONF['default_rank_button'] = 'https://www.ppntop50.com/images/buttons/xmas/0.gif';
    $CONF['button_dir'] = 'https://www.ppntop50.com/images/buttons/xmas';
    $CONF['button_ext'] = 'gif';
    $CONF['button_num'] = 300;

    $CONF['stats_button'] = 0//Show Dynamic Stats Button

    $CONF['hidden_button_url'] = 'https://www.ppntop50.com/images/clear.png';

    ?>
  9. Basti
    • Staff

    Basti Administrator Staff Member

    I don't have the same as you anymore,
    General part says https, which redirects to http image itself, Location: http://www.ppntop50.com/images/buttons/sky/8.gif

    You MUST have something custom like I asked before somewhere.
    There is no way button.php returns buttons/sky if your button config is defined as buttons/xmas

    And in that custom thing, things must be wrong
  10. PPNSteve

    PPNSteve PPN Top 50

    no custom things.. its not liking the "&buttontype=rank" part in the button image link.. for whatever reason

    [​IMG]
    notice its even doing it in the sample link

    not sure what is causing it but it's very annoying
  11. Basti
    • Staff

    Basti Administrator Staff Member

    I cant help you further here man im sorry. Not without ftp access.
    Fact is your button config says /xmas , but /sky is returned. There has to be something custom, either as a plugin which modifies something, or a redirect directly in cpanel.
    But fact remains that there has to be something

Share This Page