Jump to content

Truly HTTPS out of the box


vegardw
 Share

Recommended Posts

When installing ProcessWire out of the box (Softaculous), there is one minor mistake in making it truly https friendly.

site/templates/_main.php - the http: has to be removed in order to load the google font accordingly to the site setup https/http.

<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title><?php echo $title; ?></title>
	<meta name="description" content="<?php echo $page->summary; ?>" />
	<link href='http://fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' />
	<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" />
</head> 

Great product! Continue the brilliance.

  • Like 3
Link to comment
Share on other sites

Not sure what you mean:

About processwire site setup see the api

https://processwire.com/api/variables/config/

Examples:

Links to fonts from google goes like this:
<link href='http://fonts.googleapis.com/css?family= . . . . . . ' rel='stylesheet' type='text/css'>

Links to your font-awesome.min.css goes like this:
<link href='/site/templates/styles/font-awesome/css/font-awesome.min.css' rel='stylesheet' type='text/css' />

Links to your internal css and js go like this:
<link href="/site/templates/webfonts/your_webfont_styles.css" rel="stylesheet">
<link href="/site/templates/your_style.css" rel="stylesheet">
<script src="/site/templates/webfonts/your_webfont_script.js"></script>

Link to comment
Share on other sites

Pwired, instead of http:// the Google fonts should be loaded just with //, then it would use http/https according to the current page.

That is of course quick change and pretty much site specific setting.

And welcome to the forums vegardw!

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By humanafterall
      Hi,
      I would like to set an admin template to 'https only' as recommended in the Processwire security docs.
      However if I do this it forces this setting locally too, resulting in https://localhost requests which result in an error page.
      Is there a simple way round this? Setting https for templates in the config?
      Thanks!
    • By cmg
      I have just installed PW, with apparent success - but at the very end I got a series of error messages relating to the file Session.php:
      Warning: session_name(): Cannot change session name when headers already sent in /homepages/15/d465648144/htdocs/4x3/wire/core/Session.php on line 246
      Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /homepages/15/d465648144/htdocs/4x3/wire/core/Session.php on line 249
      Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /homepages/15/d465648144/htdocs/4x3/wire/core/Session.php on line 250
      Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /homepages/15/d465648144/htdocs/4x3/wire/core/Session.php on line 251
      Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /homepages/15/d465648144/htdocs/4x3/wire/core/Session.php on line 252
      The home page of my site displays OK, but when I click on the nav buttons I get errors. Same when I use the admin URL.
      Help!
      Chris
       
       
       
       
       
    • By Peter Knight
      Hi all
      My .htaccess file is correctly redirecting all requests to
      https:// www. That's great until I want to work locally.
      I thought I had seen a blog post by Ryan where there was a new config setting to ignore both of these if working from localhost?
      I can't find it now so wondering if I was imagining 😕
       
       
    • By alanxptm
      Hi, I have already tried in different ways and many times to migrate but I always have issues at the end.
      Here's what I have done so far:
       
      case 1:
      1. Install PW on live server (all normal)
      2. Import local DB into live DB
      3. Front page site seems to work but I cannot login into admin page
      case 2 (I'm currently on this stage):
      1. Copied all files from local to live server
      2. Import local DB into live empty DB
      3. Front page works, but any other page and admin page are 404
       
      In both cases:
      - I have changed config.php info accordingly to live server (DB name, DB user and pwd, userauthsalt code)
      - Uncommented RewriteBase / and RewriteBase /pw/ lines on .htaccess
      - applied owner and group permissions to www-data for PW location
      - applied permissions to folders and files accordingly
      - applied a2enmod rewrite to apache2 on live server and restarted service
       
      I have read some posts (Ryan's too) about migration and it seems to me that I'm doing it fine, don't know what it fails-
      I'm on VMWare machine, Ubuntu Server 18.04, php 7.2, phpMyAdmin 5.0.1
      Hope you can help me, thanks in advance
    • By rushy
      Hi. I've been using Processwire for a few years now and installed it on a few different shared hosting servers without issues, but I'm now running into an issue on a Fasthosts shared server that I've not seen before. The installation goes ok and I have a working default site profile but I am unable to complete any uploads of images. It just hangs at the progress spinner during the upload. I thought it might be a priviledge issue so have temporarily set the dir / file privs. as 777 / 666 just to test that but it made no difference. I have no errors in the wire log. In server error log I have:
      set_time_limit() has been disabled for security reasons in ....htdocs/wire/core/ImageSizerEngine.php on line 1035 and i note in the assets/file dir. where the image is being stored the date on the file being created has a year of 1970 and 0 length. If I leave the page this file disappears and nothing has been stored. 
      Does anyone know how I can enable set_time_limit if this is likely to be the problem? 
      Many thanks! Paul
×
×
  • Create New...