Version check SSL/.htaccess

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Version check SSL/.htaccess

Post by Restless Rancor » Sat Oct 20, 2018 10:06 am

Hi, I thought I'd tackle adding a version check to an extension I've been working on but have run into a problem with SSL and .htaccess.

I've followed these instructions and can successfully check the version of the extension if the version_check.json file is located under a non-ssl domain.

After some research, I believe it is to do with my .htaccess, but can't figure out what I need to change.

My composer.json:

Code: Select all

{
    "name": "restlessrancor/postcountonindex",
    "type": "phpbb-extension",
    "description": "Displays a logged in member their post count on the index page",
    "homepage": "https://www.restlessrancor.com",
    "version": "0.0.2-dev",
    "time": "2018-10-19",
    "license": "GPL-2.0-only",
    "authors": [{
            "name": "Restless Rancor",
            "email": "contact@restlessrancor.com",
            "homepage": "https://www.restlessrancor.com",
            "role": "Author"
            }],
    "require": {
            "php": ">=5.3.3",
            "composer/installers": "~1.0"
    },
    "extra": {
            "display-name": "Post Count on Index",
            "soft-require": {
            "phpbb/phpbb": ">=3.1.4,<3.2.0@dev"
    },
    "version-check": {
            "host": "restlessrancor.com",
            "directory": "/versions/postcountonindex",
            "filename": "version_check.json",
            "ssl": "true"
            }
    }
}
The .htaccess on https://www.restlessrancor.com contains one line, Redirect 302 / https://forum.restlessrancor.com - I'll eventually put a homepage in that location, but for now it redirects to the subdomain containing the forum.

I changed the .htaccess to:

Code: Select all

Redirect 302 / https://forum.restlessrancor.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
but this did not work. I'm sure it's to do with what I have in that file, if someone could help me get it working that'd be great.
Many thanks.
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3378
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Version check SSL/.htaccess

Post by kasimi » Sat Oct 20, 2018 10:30 am

It seems the version file doesn't exist: https://forum.restlessrancor.com/versio ... check.json

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: Version check SSL/.htaccess

Post by Restless Rancor » Sat Oct 20, 2018 10:35 am

Hi kasimi,
The version file is located at https://www.restlessrancor.com/versions ... check.json


Edit:
Sorry, I should have broadened my search terms.

I replaced the .htaccess at https://www.restlessrancor.com with

Code: Select all

RewriteCond $1 !^versions
RewriteRule (.*) https://forum.restlessrancor.com/$1 [R=301,L]
It now redirects all traffic to the forum. subdomain, except for the /versions folder. The version check is now succesfull.

Cheers :geek:
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 14 guests