2012-03-13, 01:03:04
I was searching for the possibilities to customize the error 404 page. Have found How to change 404 error message (lang) and have added that info to /wiki/404
Then I have found a discussion of (i think) Pre 3.0 time: 404 Page Translation : Dev Questions & Vote. Quotes from there:
I use GS 3.1 and I18N 2.6 with (de) as standard and (en) and (it) as secondary languages. I have enabled FancyURLs with "%language%/%parent%/%slug%/". I haven't found better informations of how 404 probably works actually on a installation like this.
I have created 404 page in german and 404_en and 404_it pages. Now when I try to view a non existing URL on the GS-Installation (exampe: domain.com/xyz) I receive with every browser language (de, en, it) every time only the (de) 404 page. Also domain.com/en/xyz did not change everything.
Can somebody help me in this, is it the .htaccess RewriteEngine ?
Then I have found a discussion of (i think) Pre 3.0 time: 404 Page Translation : Dev Questions & Vote. Quotes from there:
mvlcek 2011-03-13 19:39:02 Wrote:Just check if there is a page with slug name 404 (404.xml) and display it, if it exists.
This way on multilanguage sites (I18N plugin), users can create pages 404_de, 404_it, etc. to present the error in the correct language.
mvlcek 2011-04-08 21:57:11 Wrote:krisu Wrote:My suggestion is that translators should able translate the 404 with translation file, but user can have control over it if he wants way that mvlcek suggested.Yes that's best: If there is a page 404.xml, display it (like a normal page is displayed, i.e. with hooks), otherwise display the default title/message, which should be read from the language files instead of being hardcoded.
By displaying the 404-page with all hooks, the correct language page can be displayed (with the I18N plugin) and one can even create a page that would display the search results from searching with the URL...
I use GS 3.1 and I18N 2.6 with (de) as standard and (en) and (it) as secondary languages. I have enabled FancyURLs with "%language%/%parent%/%slug%/". I haven't found better informations of how 404 probably works actually on a installation like this.
I have created 404 page in german and 404_en and 404_it pages. Now when I try to view a non existing URL on the GS-Installation (exampe: domain.com/xyz) I receive with every browser language (de, en, it) every time only the (de) 404 page. Also domain.com/en/xyz did not change everything.
Can somebody help me in this, is it the .htaccess RewriteEngine ?
Code:
# RewriteRule ^/?$ de/ [R,L] # redirect to language of your choice. Quote out if undesired.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de|it)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de|it)/?$ index.php?lang=$1 [QSA,L] # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.