Changing your theme

Sometimes you just want to make smaller changes to your theme, it might be a logo that should be different, or a background color. Some themes doesn’t allow you to do this under Appearance – Customize, only in their PRO version. You could do it by altering the themes files, but if you are runnuing a multisite wordpress, your changes might affect several sites.

Instead you can use the Simple Custom CSS plugin, which allows you to write your own css that will override the ones from the theme. Here is an example:

.left_container {
background:none !important;
div { background: red; 
}
}
img#site-title {
content:url("http://photohelge.w.uib.no/files/2017/09/logo-helge-3.gif") !important;
height: 25%;
width: 25%;
}

Where I have changed a background color for class=left_container to none, and also chosen my own image for the logo.

different-logo-than-default-theme-logo

Rewriterule HTTP_HOST in Apache

We had to rewrite some specific domain names in our WordPress multisite.

Most of our domains are on this form: something.w.uib.no

In our case that is nice, because we also have a valid ssl certificate which supports *.w.uib.no.

But in addition we have other domain names on the form: something.uib.no

which we don’t have a valid ssl cerificate. When a wordpress administrator tries to log in to:

* http://something.uib.no/wp-login

he/she is met with a scary ssl certificate warning. (Because we don’t have SSL certificates for these domain-names)

Our solution was to redirect this request with some Apache rewrite rules:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-login\.php [or]
Rewritecond %{REQUEST_URI} ^/wp-admin$
RewriteCond %{HTTP_HOST} !^(([^.])+\.b\.uib\.no)$
RewriteCond %{HTTP_HOST} ^([a-z.]+)?uib\.no$ [NC]
RewriteRule .? https://%1w.uib.no%{REQUEST_URI} [R=301,L]

which says something like:
If REQUEST_URI starts with wp-login.php OR wp-admin, AND the HTTP_HOST (domainname) is NOT LIKE something.w.uib.no AND HTTP_HOST IS something.uib.no, THEN
rewrite the whole thing to a new URL with  301 (permanently moved). The %1, which is the match in the regular expression above is part of the new URL.

In this way we could make sure that the users of wordpress instances with http://something.uib.no, would be redirected to a proper domain name, and thus with a valid SSL certificate.

See also:
http://www.webforgers.net/mod-rewrite/mod-rewrite-syntax.php
http://support.hostgator.com/articles/cpanel/articles/getting-started/general-help/apache-mod_rewrite-and-examples
http://httpd.apache.org/docs/current/mod/mod_rewrite.html (se: RewriteCond backreferences)

You might ask “Why not just order and install the SSL certificates as needed?”.

The answer is that ordering SSL certificates is a very manual process and takes a lot of administration and time, involving a lot of people. We want to avoid such and make things as simple as possible.

Create a PDF book of your WordPress blog

If you are thinking of creating a PDF file from all your posts in your WordPress blog, you can try this:

First, use the Tools – Export to create a xml file. Save it.

Then go to: http://blogbooker.com/wordpress.php

Upload your xml file, and Blogbooker will create it, and you can download the result afterwards.

Here is some posts exported to a pdf book from my Blog: blogbooker-book