Previous Thread
Next Thread
Print Thread
Hop To
Page 2 of 2 1 2
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
A couple questions.

In the past many years ago I had a rule forcing EXAMPLE.com to become www.EXAMPLE.com somewhere
Now when reading a bit about .htaccess it seems that it nowadays are more common to do the opposite.

Now when I am about to transit HTTP to HTTPS could it be wise to also don't use 'www' in the url?

it might be good to know before changing in CP and then switching all links to HTTPS in the SQL.

I see that this UBBCentral forum and Gizmo is using WWW in his agardner forum and [name] is forcing WWW into NON-WWW in their forum.
What is the advantage/disadvantage to use HTTPS://example.com vs HTTPS://www.example.com

Thanks for your input


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
my 2 cents.

It is your preference.
Other than your visitors and agents now goto www via bookmarks or redirects.

Whatever you decide it should be consistent across all pages if you want the secure icon to appear and not show mixed content.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Can I ask if you think I reason right
My Cloudflare settings sends HTTP & HTTPS links thru as is.
I have no pages rules there to convert to HTTPS just allow the protocoll.

I have now created a test - have rewritten the rules for my subdomain "forum.EXAMPLE.com" in my host's cpanel which normally points to /forums
it is now rewritten like this..

# END cPanel-generated php ini directives, do not edit
RewriteCond %{HTTP_HOST} ^forum\.EXAMPLE\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.forum\.EXAMPLE\.com$
RewriteRule ^/?$ "https\:\/\/www\.EXAMPLE\.com\/" [R=301,L]

Please click on below links to test:
http://forum.EXAMPLE.com
http://www.forum.EXAMPLE.com
https://forum.EXAMPLE.com

They all should result in "https://www.EXAMPLE.com"

I have tested and it works. Would you say that it proves that HTTPS works on www.EXAMPLE.com ???
If so then I could go ahead with Isaac's list at #3 ??? after a backup is made..
Quote
3) Update ALL your URLs in the Control Panel or manually in your config.ini file. This includes the Homepage URLs, Contact pages, Referer Check, any forum headers/footers, etc.
4) Run a SQL query on your posts, private messages, user avatars, profile comments tables to replace "http://www.YOURDOMAIN.COM" with "https://www.YOURDOMAIN.COM"
5) Set up HTTP to HTTPS 301 redirects in your .htaccess file to forward from http:// to https://
6) Update all external plugins to ensure they are HTTPS compliant (sharaholic, twitter, facebook, youtube, ubb custom-tags, and, if your website contains non-UBB.threads content, all those internal site links - trust me you won't find them all in a single pass)
7) Test your website.
BONUS: Update your URLs in google/bing webmaster tools. Update any ads placed on your website, such as Google Adsense. Update any website analytics code.

Thanks for your assistance


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
I don't have a clue what the \/ \/ is in your path came from.
Code
RewriteRule ^/?$ "https\:\/\/www\.EXAMPLE\.com\/" [R=301,L]

But I guess it works

What was wrong with isaacs method:
Code
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Or just using gizmos method of cloudflare.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Ruben,

It was done in my hosts CPANEL, there was a form to fill in and I choose to have both non WWW and WWW
forum.EXAMPLE.com. and
www.forum.EXAMPLE.com to
be converted to HTTPS://www.EXAMPLE.com in this test
The CPANEL created the code in the .htaccess file

I din't want to use it for EXAMPLE.com in the test only for the subdomain.

So when I go fully live it would be best to point non WWW and WWW as in EXAMPLE.com and www.EXAMPLE.com to become
HTTPS://www...
would that be done by Isaacs code?
You said self its best to consequent so all urls should become www If I chose that.

I hope you understand what I try to explain


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Ruben,
I have now tested Isaacs way and uploaded his code
It turns HTTP into HTTPS but not into HTTPs://www if its not www in the first place.

so ff you test
HTTP://forum.EXAMPLE.com it becomes HTTPs://forum.EXAMPLE.com
and
HTTP://www.forum.EXAMPLE.com it becomes HTTPs://www.forum.EXAMPLE.com
Would it not be best to rule that it becomes HTTPs://www.forum.EXAMPLE.com only???

I know I can set it up in Cloudflare but its a learning process and I want to use my own host to provide the SSL
I have hopes to close the forum tonight and start transition in the morning when I wake up so it would be best to know which code to use in the .htaccess.

Thanks for your input


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Well it works .

If you wish to force all www and non www EXAMPLE.com requests to https://www.EXAMPLE.com

That is all I can say.

But you still need to complete the rest of the tasks .


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
1 member likes this: Morgan
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Yep this was a test to see if the code converts to HTTPS and that it works to view the page without error
thanks


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Just remember that it is a big task to find all the urls that cause the site to not appear fully secure without mixed content.
Also when using cloudflare there is a cache they use so if you make corrections it may not fix items immediately to view.
Cloudflare does have a clear cache button but I would not try that till you think you got everything.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Set cloud flare to development mode while you are making changes; then clear your CF Cache when you're complete...

By the way, when you are working with an htaccess file and you have to utilize a forward slash you must comment it out with a backslash; that is why Morgan's example shows backslashes in it.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Originally Posted by Gizmo
Set cloud flare to development mode while you are making changes; then clear your CF Cache when you're complete
Thanks Gizmo for the tip.

Ruben, Thanks for the input. I have deleted all pages on my website except for 15 pages that have new HTML5 and responsive layout. Have only used relative links like "/folder/example.html" there should not be any HTTP links.. knock on wood.
Links to other sites have HTTPS urls only.

All old pages will be deleted until I can edit them and upload one by one but that is in the future.

I will follow and use Isaacs steps and code.
Will download backup and also await the backup AM03.00 local time and start transition in the morning.
The UBBthreads will be closed about 10hours and I will disable register accounts as well.

Oh I have one more .htaccess question. Hope its ok to ask


This the top part of my .htaccess file it was first created in year 2000 i believe. Can I delete the red marked parts?
I don't use any cgi scripts now and the last row pointing to UBB/BIN is not there anymore. its deleted.

Quote
RewriteEngine on
#Options -Indexes FollowSymLinks Includes
AddType application/x-httpd-cgi .cgi
AddType text/html .html

Options +ExecCGI
AddHandler server-parsed .html
ErrorDocument 404 /errors/404.html

#RewriteBase /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

Last edited by Morgan; 02/02/2021 3:22 PM. Reason: Removed some .htaccess parts

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Seems fairly stock, I'd keep this part at least:
Code
RewriteEngine on
#Options -Indexes FollowSymLinks Includes
AddType application/x-httpd-cgi .cgi
AddType text/html .html

Options +ExecCGI
AddHandler server-parsed .html
ErrorDocument 404 /errors/404.html

#RewriteBase /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Thanks Gizmo I will edit my .htaccess file and the post here and remove the other part from as well.
Many thanks


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Transition is done, knock on wood it works. No error so far.
Have opened the forum.
Thanks for your assistance!


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Page 2 of 2 1 2

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
0 members (), 744 guests, and 147 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)