Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 [2] 3 4

Author Topic: DNS records or htaccess help please  (Read 12609 times)

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #15 on: April 28, 2018, 09:58:29 AM »

Thanks guys.  Bear with me typing excruciatingly slow with just forefingers.

I've replaced the htaccess with this

Code: [Select]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I think this may be working, can you see if its ok your side too please.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

jelv

  • Helpful
  • Kitizen
  • *
  • Posts: 2054
Re: DNS records or htaccess help please
« Reply #16 on: April 28, 2018, 10:03:59 AM »

Looks OK here.
Logged
Broadband and Line rental: Zen Unlimited Fibre 2, Mobile: Vodaphone
Router: Fritz!Box 7530

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DNS records or htaccess help please
« Reply #17 on: April 28, 2018, 10:10:08 AM »

Hi Kitz

I hope your well

I am sorry, tapatalk failed to connect yesterday afternoon when I tried to look at kitz forum.  I thought it was tapatalk but guess it is SSL

It looks lovely from here in a browser

We sometimes use the following in vhost file, to save .htaccess

RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Either way works lovely

Apologies for any delays

Many thanks

John
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #18 on: April 28, 2018, 10:12:05 AM »

Thank you.  It does seem to be doing the job and directly replacing http with https. :)

Whilst making changes and before making anything permanent, am I asking too much to add another rule so that it drops the www for kitz.co.uk?  and if so do you know how I'd do this please?

Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #19 on: April 28, 2018, 10:21:09 AM »

We sometimes use the following in vhost file, to save .htaccess

RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Would I need to get my hosts to do that?   
Would that affect everything on my server including the domains which are parked on the other account eg http://www.kitz.me.uk/ which is on the first account.   I'm not quite sure how it was split up as my hosts did that..  other than know that it keeps all the site stuff (including broadbandinfo) on just one CPanel account.

TBH I really don't know what Im doing when it comes to server stuff, which is why I pay for managed hosting.   Problem being is they want >£200 pa to configure and sort a wildcard SSL (which is what I'd need because of the subdomains) so I'm trying to save some money and do it myself.
« Last Edit: April 28, 2018, 10:26:10 AM by kitz »
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: DNS records or htaccess help please
« Reply #20 on: April 28, 2018, 10:24:06 AM »

Its fine as is kitz.

It can be done in a vhost instead of htaccess, both ways work.

The difference is that the vhost is a configuration file for the webserver, usually edited by the server admin or automatically by control panel software.

htaccess is easily edited by the webmaster (which is yourself), both work the same.  Vhost is arguably more secure as isnt accessible if your user area is compromised.

The regex supplied does the same thing as well, his just adds the 301 redirect, otherwise is same as what I gave you.

So when you happy with how its behaving, its just adding the 301 to satisfy google, this can be normal riskier way or using the cached method I supplied, its up to you.
Logged

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DNS records or htaccess help please
« Reply #21 on: April 28, 2018, 10:24:54 AM »

Hi Kitz

Tapatalk now working lovely thank you

Yes, you can as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Should work but not tested it

Also, in Cpanel, you can complete all this from within Cpanel using GUI I believe.  It is same in Interworx (might be outdated as I do not use Cpanel sorry)

https://www.webhostinghub.com/help/learn/cpanel/redirect-domain-www-or-non-www-url

I hope that helps a little but sorry if I am wrong

Many thanks

John
Logged

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DNS records or htaccess help please
« Reply #22 on: April 28, 2018, 10:40:45 AM »

Hi kitz

Sorry, just rereading and now using Tapatalk

Are you using let’s encrypt for ssl. CPanel should have this as standard option. Interworx does

If so, you highlight all names you need LE to cover - eg common name, www, forum etc... as long as they are on your server and DNS points to your server for those you chose, it should create ssl and self install (about a minute to do from GUI)

Let’s encrypt are changing to allow wild card ssl but not sure if it’s out yet

Many thanks

John
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: DNS records or htaccess help please
« Reply #23 on: April 28, 2018, 10:40:45 AM »

kitz you want the www. rewrite on all traffic or just http or just https?

I will post a rewrite for it then.

I will also include 301, and put that part of it in bold.
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #24 on: April 28, 2018, 10:49:14 AM »

The difference is that the vhost is a configuration file for the webserver, usually edited by the server admin or automatically by control panel software.
I do have access to WHM for server admin, which supposedly controls everything but I'm not at all familiar with it so leave things well alone in there.
If I look in WMH I can see where the accounts have been partitioned into the separate cpanel accounts.    WHM has a lot of (for me) scary stuff such as long lists of config options, all the DNS records and other things such as ability to reboot server, restart http etc, ability to create accounts, set bandwidth limits etc. 

I just stick to CPanel for the site admin.

Quote
htaccess is easily edited by the webmaster (which is yourself), both work the same.  Vhost is arguably more secure as isnt accessible if your user area is compromised.

I've been directly accessing the htaccess file in the root and editing in notepad.


Quote
The regex supplied does the same thing as well, his just adds the 301 redirect, otherwise is same as what I gave you.

So when you happy with how its behaving, its just adding the 301 to satisfy google, this can be normal riskier way or using the cached method I supplied, its up to you.

Cheers Im going to try add in the code that d2d4j has given first and see if I can get that to work too before I do anything permanent
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #25 on: April 28, 2018, 10:53:00 AM »

Are you using let’s encrypt for ssl. CPanel should have this as standard option.

Yes I'm using LetsEncrypt.    I can't see anything in CPanel.    I got my webhosts to add it.    There may be something in WHM as I can see there is an SSL section in there now.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DNS records or htaccess help please
« Reply #26 on: April 28, 2018, 10:58:00 AM »

Hi kitz

Many thanks

That sounds like they have turned on ssl option. If so, you should see let’s encrypt option, so when generating all using LE, one option should be names to cover. This is where you select all subdomain to cover as well as common name. Then generate and in less then a minute, it’s completed

If using my script, please make sure you change http to https on last line. Sorry, too many years working on http

Most control panels look scary, but usually not too bad and self explanatory.

Many thanks

John
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: DNS records or htaccess help please
« Reply #27 on: April 28, 2018, 11:08:05 AM »

yes sorry I missed he put http not https. 

Try not to confuse yourself here tho kitz, this does not need to be added to both the vhost and htaccess, one of them is fine.
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #28 on: April 28, 2018, 11:19:44 AM »

No double checked nothing in my CPanel for the kitz partition.

I have this in WHM for which I have to log in as server admin which is separate name (ie me) to the kitz site admin for CPanel, but I can't see anything specific to LetsEncrypt in CP or WHM 

--
Info and image removed
« Last Edit: April 29, 2018, 06:05:39 PM by kitz »
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DNS records or htaccess help please
« Reply #29 on: April 28, 2018, 11:20:02 AM »

Hang on someone at door BBL
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker
Pages: 1 [2] 3 4
 

anything