DeutschEnglish

Submenu

 - - - By CrazyStat - - -

16. March 2016

Typo3: Redirect backend to https and frontend to http

Filed under: PHP,Security,Server Administration,Typo3 — Tags: , , , , , , , , , — Christopher Kramer @ 20:02

If you are using SNI to secure the access to your site through SSL, you might decide that you do not want to use SSL for the frontend, as users of old clients such as Android 2 or Internet Explorer 8 on Windows XP won’t be able to access the site. But for the backend, old clients should not be a problem.

So this solves the redirection in two ways:

  1. Frontend gets redirected to HTTP if accessed through https (optional)
  2. Backend gets redirected to HTTPS if accessed through http

Put this in your .htaccess after “RewriteEngine On” (assuming Apache webserver):

# 1. optionally: redirect FE to http
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/?typo3
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# 2. redirect BE to https
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/?typo3
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

And hopefully, your backend access is now securely encrypted…

https

 

Recommendation

Try my Open Source PHP visitor analytics script CrazyStat.

15. February 2012

WordPress: Frontend and Backend in different Language

Filed under: Wordpress — Tags: , , , , , — Christopher Kramer @ 23:45

In case you want to use a different language for the wordpress frontend (your blog) and the backend (admin panel), here is a tip how it can be done.

Step 1: Set frontend language

Configure the language of WordPress for the language you want your frontend in. You do this in wp_config.php using the constant WPLANG:

define ('WPLANG', '');

This unsets the language, meaning the frontend will be English. This also works if you use a localized version of wordpress. If you want to set another language, do so:

define ('WPLANG', 'de_DE');

This would set the language to German. You need to have a corresponding .mo-file in wp-content/languages (in this example, wp-content/languages/de_DE.mo).

Step 2: Set the backend language

Step one will also affect the backend. If you want to have the backend in another language, there is a neat little plugin which changes the backend language for you, which I found on this forum.

<?php
/*
Plugin Name: Change backend language
Version: 0.5
Plugin URI: http://forum.wordpress-deutschland.org/konfiguration/32642-frontend-soll-englisch-sein-adminbereich-deutsch-engl-od-deut-download-nehmen.html
Description: Changes the backend language
Author: Oliver Schlöbe
Author URI: http://www.schloebe.de/
*/

function os_setAdminLang($locale) {
    if( WP_ADMIN === true ) {
        $locale = 'de_DE';
        return $locale;
    }
}

add_filter('locale', 'os_setAdminLang', 1, 1);
?>

This changes the backend language to German. In case you want another language, change ‘de_DE’ to the desired language in line 13. You need a corresponding .mo-file just like for the frontend.

Save this as something like wp-content/plugins/change_be_language.php

Then active the plugin in your backend and your backend will turn into the language you set.

Attention: Make sure there are no extra spaces in the plugin-file. Especially at the end, some editors tend to add spaces or line breaks. This will result in problems (headers cannot be sent etc.).

Hope someone finds this useful.

Update: Just found out, that the author wrote a blog post himself about this (English text at the bottom of the page)…