Help with the Urls

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Help with the Urls

Post by zedd9165 » Wed May 16, 2018 9:40 am

Hello everyone,

I'm new to PHPBB and in love with the software. However, I'm facing issues with the urls, I have installed an SSL certificate but its the URL shows green pad only when I try to access the forum using https://forums.beyondgains.com or https://www.forums.beyondgains.com but when I try to access the forums using www.forums.beyondgains.com or forums.beyondgains.com it shows a warning that the website isn't secure.

Earlier when I was testing another forum I faced similar issue but with a little tweaking in the htaccess(i guess) the issue was solved. But now I'm not sure if I should add a redirect in htaccess or is there any other option.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 19099
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Help with the Urls

Post by Mick » Wed May 16, 2018 9:49 am

To redirect to HTTPS you can add something like this to the beginning of your .htaccess file:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
IMO you should always use HTTPS when writing a URL.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.
Forza Garibaldi

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Wed May 16, 2018 9:59 am

I totally understand that I should use HTTPS every time to access my website however my visitors might not always use https they might simply type www.example.com or just example.com what in such cases?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2600
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Help with the Urls

Post by thecoalman » Wed May 16, 2018 10:50 am

The .htaccess rule provided by mick will check to see if the request is for https and redirect the user to https if it is not.

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Wed May 16, 2018 1:00 pm

I shall surely check this and get back.

User avatar
John connor
Registered User
Posts: 1522
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: Help with the Urls

Post by John connor » Wed May 16, 2018 2:38 pm

The reason for the URL discrepancy is probably due to the Cert not being generated for those URLs. In cPanel you may have had an option to what URLs the Cert should be issued for. At least that's what I saw when I generated my Certs.

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Wed May 16, 2018 4:25 pm

Okay, guys Im facing a serious problem now. I have two different outcomes from two similar URLs.

https://forums.beyondgains.com doesn't allow me to login/register via google chrome. While https://www.forums.beyondgains.com lets me login/register on chrome normally. I checked on internet explorer both urls have no issues. However, I think that these two urls are acting like mirror images. This is getting me really confused.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2600
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Help with the Urls

Post by thecoalman » Wed May 16, 2018 8:22 pm

If you made any changes to anything and it's now broken back out of them.

A brief explanation. The www in www.example.com is a legacy thing and technically a subdomain of example.com, other common subdomains are mail., ftp., etc The idea is that each designated a different resources and in this case the www was for public web pages. Most people have dropped the www to shorten the domain name but using one or the other is fine. Checking you main domain the non www version is redirected to the www version which is what you want to do if not the other way around. It's also correctly redirecting http to https so everything is good there.

forums.example.com is also a subdomain of example.com and when you have www.forums.example.com the www is subdomain of forums.example.com, that is technically doable but never used so just forget about that URL.

I'm getting an error for the SSL as invalid for forums.example.com so that's one issue, you need a SSL cert that covers each subdomain. When they issue a cert typically it will cover the www subdomain. Additionally when I make an exception for the invalid certificate I'm getting a 403 forbidden which is another issue.

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Wed May 16, 2018 10:07 pm

Coalman,

Thank you for the brief explanation. Yes I had delete the forums and the domain completely sins it was a total mess because of the redirection www.example.com and example.com were working totally different and were creating issues. Therefore I had to pull it off completely and reinstall it.

But I need to ask a question, arent www.example.com and subdomain.example.com supposed to take the user to the same webpage?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2600
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Help with the Urls

Post by thecoalman » Wed May 16, 2018 11:27 pm

zedd9165 wrote:
Wed May 16, 2018 10:07 pm
Therefore I had to pull it off completely and reinstall it.
If this fresh install then why not avoid all these hassles and put it in example.com/forum ?
arent www.example.com and subdomain.example.com supposed to take the user to the same webpage?
I'm not exactly sure what you are asking. WWW is a subdomain, for legacy reasons the standard configuration on a server is to serve the same exact content for www.example.com and example.com. It could be configured to serve completely different content.

This is why you want to redirect example.com to www.example.com or the other way around. Google and other search engines treat this as two different sets of resources.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 19099
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Help with the Urls

Post by Mick » Thu May 17, 2018 7:42 am

The url without www is the correct one. If, when you put www in the url as in this case, you’re not redirected to the non www address I’d suggest you should ask your host about it. My host hasn’t used www since 2007 and I’ve never had to do my own redirect for www only https.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.
Forza Garibaldi

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Thu May 17, 2018 9:36 am

@mike

Thank you for the response, yes my issue since the beginning was this that when i tried to reach my website through www prefix it doesn't work, this might cause me to lose a lot of traffic in future. In simple words, all I wanted was that people should be able to reach the forums no matter what URL they use www or just example.com.

I assume that I would need to solve the issue first by contacting my host and activate the access through www.forums.beyonds.com and then I should add a code that redirects traffic to forums.beyondgains.com

Hope im on the right track now.

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

Re: Help with the Urls

Post by janus_zonstraal » Thu May 17, 2018 10:30 am

This code in your .htaccess file will work and send everybody to the non www version of your site.

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Sorry! My English is bat ;) !!!

zedd9165
Registered User
Posts: 7
Joined: Wed May 16, 2018 7:04 am

Re: Help with the Urls

Post by zedd9165 » Thu May 17, 2018 10:32 am

janus_zonstraal wrote:
Thu May 17, 2018 10:30 am
This code in your .htaccess file will work and send everybody to the non www version of your site.

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Buddy thank you soo much for the help.

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: AbaddonOrmuz, Country-Man, DanielGarneau, Froddelaar, jw06033, stevemaury and 34 guests