{SOLVED} perplexing problem with https and http ( vid explains )

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Ideas Centre
Post Reply
JohnnyBigSpuds
Registered User
Posts: 91
Joined: Tue Apr 22, 2014 5:49 pm

{SOLVED} perplexing problem with https and http ( vid explains )

Post by JohnnyBigSpuds » Mon Nov 13, 2017 8:44 pm

having got SSL and been using http and not knowing how to sort it so that it runs via SSL
so that it does not give insecure site warnings on firefox and chrome i contacted my host
to sort it out.
my site is

Code: Select all

https://ukgunbook.com
Now here is where it gets sketchy

SUCCESSES

Code: Select all

https://ukgunbook.com     Goes direct to that site without problem.  


Code: Select all

https://www.ukgunbook.com      Goes direct to that site without problem. 


FAILS

Code: Select all

http://ukgunbook.com     fails and goes to

Code: Select all

https://www.ukgunbook/        No .com at the end


Code: Select all

http://www.ukgunbook.com     fails and goes to 

Code: Select all

https://www.ukgunbook/       No .com at the end 


Code: Select all

ukgunbook.com     fails and goes to

Code: Select all

https://www.ukgunbook/        No .com at the end
There is a video showing this here

Code: Select all

 [url]https://www.youtube.com/watch?v=cNPEFYmF3c4[/url]
I have spoken with my host who has even visited the board as an admin and they cannot figure out what is wrong.

Here is part of the convo with the host tech support:
13/11/2017 01:42
Hello Johnny,

I have gone ahead and have added a rule, please give this some time to update and let's see if this works. Meanwhile can you give me admin area access to your website in case there is any specific settings we need to enable too?

Kind Regards,
S
Technical Support Agent
13/11/2017 06:26
Hello Johnny,

I've tried making some changes but this doesn't appear to be a server sided issue.

As we're not fluent with the site I'm not entirely sure about what to do further with this, have you tried asking on the support for the software?

I've checked your configuration in the admin area and correctly any anomalies

Kind regards,
B
Can anyone shed any light on this? or suggest ANY location and file name of any file that may have something to do with the incorrect destination? all i can think of is one of the the phpbb files may have been changed?
( done some mods to portal mod to get it to show as front page etc and have checked all the files i remember changing for that destination )

Once this is rectified i will be able to sleep again lol thanks guys
Last edited by JohnnyBigSpuds on Tue Nov 14, 2017 6:59 pm, edited 1 time in total.

janus_zonstraal
Registered User
Posts: 1799
Joined: Sat Aug 30, 2014 1:30 pm

Re: perplexing problem with https and http ( vid explains )

Post by janus_zonstraal » Mon Nov 13, 2017 8:50 pm

What is inside your .htaccess file?
Sorry! My English is bat ;) !!!

JohnnyBigSpuds
Registered User
Posts: 91
Joined: Tue Apr 22, 2014 5:49 pm

Re: perplexing problem with https and http ( vid explains )

Post by JohnnyBigSpuds » Mon Nov 13, 2017 8:58 pm

janus_zonstraal wrote:
Mon Nov 13, 2017 8:50 pm
What is inside your .htaccess file?
my host reconfigured some things to try and sort it and there is now 2 X .htaccess files

.htaccess

Code: Select all

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
.htaccess2

Code: Select all

DirectoryIndex app.php index.php index.html index.htm
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
RewriteCond %{HTTP_HOST} ^ukgunbook\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ukgunbook\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.ukgunbook\.com\/" [R=301,L]

janus_zonstraal
Registered User
Posts: 1799
Joined: Sat Aug 30, 2014 1:30 pm

Re: perplexing problem with https and http ( vid explains )

Post by janus_zonstraal » Mon Nov 13, 2017 9:09 pm

I think it has to be

Code: Select all

RewriteRule ^(.*)$ https://www.ukgunbook.com/$1 [R,L]
But use the second .htaccess ! and rename it to .htaccess
Sorry! My English is bat ;) !!!

User avatar
3Di
Registered User
Posts: 11864
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano - Frankfurt
Name: Marco
Contact:

Re: perplexing problem with https and http ( vid explains )

Post by 3Di » Mon Nov 13, 2017 11:57 pm

JohnnyBigSpuds wrote:
Mon Nov 13, 2017 8:58 pm
my host reconfigured some things to try and sort it and there is now 2 X .htaccess files

.htaccess

Code: Select all

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
.htaccess2

Code: Select all

DirectoryIndex app.php index.php index.html index.htm
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
RewriteCond %{HTTP_HOST} ^ukgunbook\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ukgunbook\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.ukgunbook\.com\/" [R=301,L]
The following is the original phpBb 3.2.1 .htaccess, I have just added these 2 lines in the right place

Code: Select all

RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Delete (make backups) both .htaccess files and save this one (as .htaccess) in your forum's root (where there is also config.php)

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
Then In ACP/cookie settings - set cookie secure to ENABLED.

Have fun.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades

JohnnyBigSpuds
Registered User
Posts: 91
Joined: Tue Apr 22, 2014 5:49 pm

Re: perplexing problem with https and http ( vid explains )

Post by JohnnyBigSpuds » Tue Nov 14, 2017 4:54 pm

Thank you guys i will have a go at this when i get home from work and post the results

JohnnyBigSpuds
Registered User
Posts: 91
Joined: Tue Apr 22, 2014 5:49 pm

Re: perplexing problem with https and http ( vid explains )

Post by JohnnyBigSpuds » Tue Nov 14, 2017 6:50 pm

3Di wrote:
Mon Nov 13, 2017 11:57 pm
JohnnyBigSpuds wrote:
Mon Nov 13, 2017 8:58 pm
my host reconfigured some things to try and sort it and there is now 2 X .htaccess files

.htaccess

Code: Select all

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
.htaccess2

Code: Select all

DirectoryIndex app.php index.php index.html index.htm
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ukgunbook/$1 [R,L]
#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
RewriteCond %{HTTP_HOST} ^ukgunbook\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ukgunbook\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.ukgunbook\.com\/" [R=301,L]
The following is the original phpBb 3.2.1 .htaccess, I have just added these 2 lines in the right place

Code: Select all

RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Delete (make backups) both .htaccess files and save this one (as .htaccess) in your forum's root (where there is also config.php)

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
Then In ACP/cookie settings - set cookie secure to ENABLED.

Have fun.
3.2.1? im on version 3.1.11 still ok?
giving it a go now

JohnnyBigSpuds
Registered User
Posts: 91
Joined: Tue Apr 22, 2014 5:49 pm

Re: perplexing problem with https and http ( vid explains )

Post by JohnnyBigSpuds » Tue Nov 14, 2017 6:58 pm

3Di wrote:
Mon Nov 13, 2017 11:57 pm
Thank you my man, you are a legend,
i added "DirectoryIndex app.php index.php index.html index.htm "
to get the Portal as my landing page, but the https is fully working.
For that my friend i am in your debt!
many many thanks

User avatar
3Di
Registered User
Posts: 11864
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano - Frankfurt
Name: Marco
Contact:

Re: {SOLVED} perplexing problem with https and http ( vid explains )

Post by 3Di » Tue Nov 14, 2017 10:43 pm

Yes, the same .htaccess file for 3.2.1 or 3.1.1, it doesn't matter.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades

Post Reply

Return to “[3.1.x] Support Forum”

Who is online

Users browsing this forum: Jobertim and 25 guests