Archiv

Artikel Tagged ‘Apache2’

Apache, PHP und MySQL auf UTF-8 umstellen

10. November 2009 Keine Kommentare

Eine kurze Anleitung, wie Apache2, PHP5 und MySQL5 auf UTF-8 unter Debian sicherstellt.

Apache2

Änderung in der Datei /etc/apache2/apache2.conf vornehmen:

AddDefaultCharset utf-8

bzw. kann man auch in Debian in der Datei /etc/apach2/conf.d/charset diese Änderung vornehmen

PHP

Änderung in der Datei /etc/php5/apache2/php.ini vornehmen:

[PHP]
default_charset = “utf-8?
[mbstring]
mbstring.language = utf-8
mbstring.internal_encoding = utf-8
mbstring.http_input = utf-8
mbstring.http_output = utf-8

MySQL

Änderungen in der Datei /etc/mysql/my.cnf vornehmen:

[client]
default-character-set = utf8
[mysqld]
default-character-set = utf8
character-set-server = utf8
collation-server= utf8_general_ci
init_connect = ‘SET collation_connection = utf8_general_ci’
init_connect = ‘SET NAMES utf8?
[mysqldump]
default-character-set = utf8
[mysqlimport]
default-character-set = utf8
[mysql]
default-character-set = utf8

Anmerkung:

Voraussetzung für die Umstellung ist die UTF8 Konvierung von Dateien und Datenbanken.

Linux Tool für die Konvertierung von Dateien ist z.B. iconv

Share
KategorienDatenbank, Howto, MySQL Tags: , ,

Canonical Redirect .htaccess Apache2 für WordPress

14. September 2009 Keine Kommentare

Canonical Hostname Redirect (non-www to www):
This solution will redirect any page requested via a non-www domain to the same URL with the www domain, and as such it can be placed in the DocumentRoot of your site and will be enforced globally:

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

Apache2 rewrite guide
Apache2 htaccess Tutorial

Share
KategorienLinux, Open Source Tags: , ,