|
Joined: Jun 2006
Posts: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
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.comThanks for your input
|
|
|
|
Joined: Dec 2003
Posts: 6,633 Likes: 85
|
Joined: Dec 2003
Posts: 6,633 Likes: 85 |
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: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
Can I ask if you think I reason rightMy 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.comhttp://www.forum.EXAMPLE.comhttps://forum.EXAMPLE.comThey 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.. 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
|
|
|
|
Joined: Dec 2003
Posts: 6,633 Likes: 85
|
Joined: Dec 2003
Posts: 6,633 Likes: 85 |
I don't have a clue what the \/ \/ is in your path came from. RewriteRule ^/?$ "https\:\/\/www\.EXAMPLE\.com\/" [R=301,L] But I guess it works What was wrong with isaacs method: 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: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
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
|
|
|
|
Joined: Jun 2006
Posts: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
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
|
|
|
|
Joined: Dec 2003
Posts: 6,633 Likes: 85
|
Joined: Dec 2003
Posts: 6,633 Likes: 85 |
Well it works . If you wish to force all www and non www EXAMPLE.com requests to https://www.EXAMPLE.comThat 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: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
Yep this was a test to see if the code converts to HTTPS and that it works to view the page without error thanks
|
|
|
|
Joined: Dec 2003
Posts: 6,633 Likes: 85
|
Joined: Dec 2003
Posts: 6,633 Likes: 85 |
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,379 Likes: 129
|
Joined: Jun 2006
Posts: 16,379 Likes: 129 |
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.
|
|
|
|
Joined: Jun 2006
Posts: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
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. 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
|
|
|
|
Joined: Jun 2006
Posts: 16,379 Likes: 129
|
Joined: Jun 2006
Posts: 16,379 Likes: 129 |
Seems fairly stock, I'd keep this part at least: 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)?$
|
|
|
|
Joined: Jun 2006
Posts: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
Thanks Gizmo I will edit my .htaccess file and the post here and remove the other part from as well. Many thanks
|
|
|
|
Joined: Jun 2006
Posts: 1,001 Likes: 27
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 1,001 Likes: 27 |
Transition is done, knock on wood it works. No error so far. Have opened the forum. Thanks for your assistance!
|
|
|
2 members (Mender, Gizmo),
101
guests, and
149
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|