Re: [PHP] https question

[email protected] (Daniel Brown)
Newsgroups php.general
Message-ID <CAD9cneMOM3SmV39c0mgQb1KrVN-mkXms9zzAvg38a5gy7v3N-g@mail.gmail.com>
On Wed, Sep 25, 2013 at 1:55 PM, Tedd Sperling <[email protected]> wrote:
> Hi gang:
>
> I have a client who had his entire site moved to another host -- no big problem.
>
> However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions?
>
> I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer.
>
> What do you recommend?

    Sounds like it may have been moved from a Plesk server to a
non-Plesk server (or something using a similar path setup).  If it's
still Apache-based, yes, an .htaccess mod_rewrite directive should
suffice.  And, while it's out-of-scope for this list, an example, for
posterity:

    # .htaccess - placed in the web root
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,R,L]


-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.