How should $PHP_SELF work with a shared-SSL certificate in HTTPS?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Hanauer

    #1

    How should $PHP_SELF work with a shared-SSL certificate in HTTPS?

    I'm getting my own SSL certificate soon because it is the right thing to
    do, but until then I have this shopping cart on an ISP that gives me free
    shared SSL. The cart breaks in HTTPS because of $PHP_SELF and the cart's
    tech support blames my ISP.

    I'm wondering if this is true.

    So, my site, let's call it mydomain.com would normally access at:


    but when viewing in HTTPS it is: https://myISP.com/mydomain.com/

    My shopping cart breaks because let's say I set up
    /temp.php
    as <?php phpinfo(); ?>

    And view in HTTP and look at PHP_SELF: /temp.php
    OK, that is normal.

    But in HTTPS PHP_SELF still gives me: /temp.php
    even though in the browser it is /mydomain.com/temp.php



    Is this normal in a shared SSL-certificate environment?


    John.


  • Virgil Green

    #2
    Re: How should $PHP_SELF work with a shared-SSL certificate in HTTPS?

    "John Hanauer" <heartsblood1@i nsightbb.com> wrote in message
    news:Xns954E8C2 A480BFheartsblo od1insightb@63. 223.5.254...[color=blue]
    > I'm getting my own SSL certificate soon because it is the right thing to
    > do, but until then I have this shopping cart on an ISP that gives me free
    > shared SSL. The cart breaks in HTTPS because of $PHP_SELF and the cart's
    > tech support blames my ISP.
    >
    > I'm wondering if this is true.
    >
    > So, my site, let's call it mydomain.com would normally access at:
    > http://mydomain.com/
    >
    > but when viewing in HTTPS it is: https://myISP.com/mydomain.com/
    >
    > My shopping cart breaks because let's say I set up
    > /temp.php
    > as <?php phpinfo(); ?>
    >
    > And view in HTTP and look at PHP_SELF: /temp.php
    > OK, that is normal.
    >
    > But in HTTPS PHP_SELF still gives me: /temp.php
    > even though in the browser it is /mydomain.com/temp.php
    >[/color]

    You need to provide a bit more information. How does it break? How are the
    results above different from before you had your own cert? Actually, I don't
    see where your cert was ever mentioned other than in the intro to your post.
    Isolate and clarify and then we can help.

    - Virgil


    Comment

    • John Hanauer

      #3
      Re: How should $PHP_SELF work with a shared-SSL certificate in HTTPS?

      "Virgil Green" <vjg@DESPAMobsy dian.com> wrote in
      news:XZLWc.1286 3$Zo1.1215@news svr22.news.prod igy.com:
      [color=blue]
      > "John Hanauer" <heartsblood1@i nsightbb.com> wrote in message
      > news:Xns954E8C2 A480BFheartsblo od1insightb@63. 223.5.254...[color=green]
      >> I'm getting my own SSL certificate soon because it is the right thing
      >> to do, but until then I have this shopping cart on an ISP that gives
      >> me free shared SSL. The cart breaks in HTTPS because of $PHP_SELF
      >> and the cart's tech support blames my ISP.
      >>
      >> I'm wondering if this is true.
      >>
      >> So, my site, let's call it mydomain.com would normally access at:
      >> http://mydomain.com/
      >>
      >> but when viewing in HTTPS it is: https://myISP.com/mydomain.com/
      >>
      >> My shopping cart breaks because let's say I set up
      >> /temp.php
      >> as <?php phpinfo(); ?>
      >>
      >> And view in HTTP and look at PHP_SELF: /temp.php
      >> OK, that is normal.
      >>
      >> But in HTTPS PHP_SELF still gives me: /temp.php
      >> even though in the browser it is /mydomain.com/temp.php
      >>[/color]
      >
      > You need to provide a bit more information. How does it break? How are
      > the results above different from before you had your own cert?
      > Actually, I don't see where your cert was ever mentioned other than in
      > the intro to your post. Isolate and clarify and then we can help.
      >
      > - Virgil
      >
      >
      >[/color]
      Virgil,

      First, sorry, I got a little busy this week. Didnt have time to test
      check this thread.

      Second, my own cert has nothing to do with anything because I haven't
      gotten it yet. That was the point of the intro was to say I'll be
      getting my own cert soon, but UNTIL THEN, I have to used a SHARED SSL
      CERTIFICATE.

      That's where my webhost has a certificate for their domain, and I can
      proxy through it in a sense by going to


      So when I do that though, and let's say my URI is
      http://myWebHost.com/mydomain.com/test.php, PHP_SELF returns /test.php
      instead of /mydomain.com/test.php which is technically the absolute web
      path to the document test.php.

      All I want to know is if that is normal or not. I don't know how SSL
      certificates and HTTPS work under PHP.

      Hope that clears things up. Summary: I'm not using my own SSL
      certificate, I'm using a shared SSL certificate through my ISP. Until I
      can get my own certificate, it would be nice to shine more light on this
      problem now.

      Thanks,

      John Hanauer.

      Comment

      • Tim Van Wassenhove

        #4
        Re: How should $PHP_SELF work with a shared-SSL certificate in HTTPS?

        In article <Xns9553C73EE40 49heartsblood1i nsightb@63.223. 5.254>, John Hanauer wrote:[color=blue]
        > So when I do that though, and let's say my URI is
        > http://myWebHost.com/mydomain.com/test.php, PHP_SELF returns /test.php
        > instead of /mydomain.com/test.php which is technically the absolute web
        > path to the document test.php.[/color]


        Following this group, i've seen the group come up with this:

        function geturl()
        {
        $ports = array('https' => 443, 'http' => 80);
        $prefix = empty($_SERVER['HTTPS']) ? 'http' : 'https';
        $url = $prefix;
        $url .= $_SERVER['SERVER_PORT'] != $ports[$prefix] ? ':' .
        $_SERVER['SERVER_PORT'] : '';
        $url .= '://';
        $url .= $_SERVER['HTTP_HOST'];
        $url .= $_SERVER['REQUEST_URI'];
        return $url;
        }

        --
        Tim Van Wassenhove <http://home.mysth.be/~timvw>

        Comment

        Working...