[GastForen Programme Web/Internet Adobe Dreamweaver .htaccess multiviews

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Web/Internet - Webdesign, eForms
Themen
Beiträge
Moderatoren
Letzter Beitrag

.htaccess multiviews

kontiki
Beiträge gesamt: 13

2. Jan 2008, 00:38
Beitrag # 1 von 7
Bewertung:
(8838 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo miteinander

Ich versuche seit einer Weile mit der .htaccess-Datei eine Mehrsprachige Seite zu erstellen. Ohne Erfolg.

Ich habe folgende Dateien.
index.html
index.html.de
index.html.en

Ich möchte, dass ein Webbrowser mit deutscher Spracheinstellung die Seite index.html.de mit deutschem Inhalt aufruft. Englischsprachige Browser sollen index.html.en öffnen. Alle anderen Sprachen sollen auf index.html verweisen (wobie dieser identisch mit der Datei index.html.en ist).

Folgendes habe ich in meiner htaccess-Datei:

Code
##### 
#
# Example .htaccess file
#
# This file contains a collection of almost everything you will need
# for optimising TYPO3:
#
# - mod_rewrite (used for SimulateStaticDocuments, RealUrl, etc.)
# - PHP optimisation
#
# If you want to use it, you'll need to rename this file to '.htaccess'.
# (To make this work you will need to adjust the 'AllowOverride'
# directive in your Apache configuration file.)
#
# IMPORTANT: You may need to change this file depending on your TYPO3
# installation!
#
# You should change every occurance of TYPO3root/ to the location where you
# have your website in. For example:
# If you have your website located at http://mysite.com/
# then your TYPO3root/ is just empty (remove 'TYPO3root/')
# If you have your website located at http://mysite.com/some/path/
# then your TYPO3root/ is some/path/ (search and replace)
#
# If you have problems with this file, try using the minimal
# mod_rewrite.htaccess which is located in the typo3_src/misc/
# directory of this installation.
#
# You can also use this configuration in your httpd.conf, but you'll have
# to modify some lines, see the comments (search for 'httpd.conf')
#
# Using rewriting in your httpd.conf is much faster, btw.
#
# Questions about this file go to the matching Install mailing list,
# see http://typo3.org/documentation/mailing-lists/
#
####

### Begin: Rewrite stuff ###

# Enable URL rewriting
RewriteEngine On

# To assist in debugging rewriting, you could use these lines
# DON'T enable it for production!
# This will only work in httpd.conf, not in .htaccess files
#RewriteLog /var/log/apache/rewrite.log
#RewriteLogLevel 9

# If you use the RealUrl extension, then you'll have to enable the next line.
# You will have to change this path if your TYPO3 installation is located
# in a subdirectory of the website root.
#
# If you place this in httpd.conf, you cannot use this directive in any case!
#RewriteBase /

# Stop rewrite processing if we are in the typo3/ directory
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L]
RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L]

# Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php
# and stop the rewrite processing
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
RewriteRule ^typo3$ typo3/index_re.php [L]

# If the file/symlink/directory does not exist => Redirect to index.php
# Important note: If you copy/paste this into httpd.conf instead
# of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each
# '%{REQUEST_FILENAME}' part.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

# Main URL rewriting.

# If you use Windows and SimulateStaticDocuments do not work, try adding a
# slash (/) right before 'index.php' below.

# The example shows how to rewrite only *.html and *.pdf files to index.php
# This may be helpful when using an extension that can generate PDF files
# on the fly.
# Example: RewriteRule .*\.(html|pdf)$ index.php [L]

# For httpd.conf, use this line instead of the next one that has no '#':
# RewriteRule .* /TYPO3root/index.php [L]

# For use with the RealUrl extension, you might need to remove the
# RewriteBase directive somewhere above and use this line instead of the
# next one:
# RewriteRule .* /index.php [L]

RewriteRule .* index.php [L]

### End: Rewrite stuff ###

### Begin: PHP optimisation ###

# All features below are left to the default if you don't change this.
# Simply remove the comment marks if you want to use some/all of these
# settings

# The PHP developers recommend disabling this feature. Do that.
# It's deprecated and is likely to be unsupported in future versions of PHP.
#php_flag allow_call_time_pass_reference off

# TYPO3 works fine with register_globals turned off.
# This is highly recommended!
#php_flag register_globals off

# PHP may not declare the argv & argc variables (that would contain the GET
# information).
# TYPO3 doesn't need this, so just turn it off.
#php_flag register_argc_argv off

# Magic quotes for runtime-generated data (data from SQL, exec(), etc.)
#php_flag magic_quotes_gpc off

# Order in which PHP registers GET, POST, Cookie and Built-in variables
#php_value variables_order GPCS

### End: PHP optimisation ###

### Begin: Miscellaneous ###

# Make sure that directory listings are disabled
#Options -Indexes

# There is a problem with Internet Explorer and mod_gzip on Apache servers.
# For more information, see
# http://typo3.org/documentation/document-library/rtehtmlarea/Tutorial-79/
#mod_gzip_item_exclude file \.css$
#mod_gzip_item_exclude file \.png$
#mod_gzip_item_exclude file \.gif$
#mod_gzip_item_exclude file \.jpg$
#mod_gzip_item_exclude file \.jpeg$
#mod_gzip_item_exclude file \.js$

Options +MultiViews
AddLanguage de .de
AddLanguage en .en
LanguagePriority en de

### End: Miscellaneous ###

# Add your own rules here
# ...

AddHandler application/x-httpd-php5 .php


Meine Website hoste ich bei www.hostpoint.ch.

Vielen Dank für eure Tipps.
X

.htaccess multiviews

SabineP
Beiträge gesamt: 7586

2. Jan 2008, 10:45
Beitrag # 2 von 7
Beitrag ID: #328859
Bewertung:
(8800 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo Kontiki,

teste doch zuerst mit einer leeren .htaccess-Datei, die lediglich die Zeile

Options MultiViews

enthält.

So kannst Du prüfen, ob Dein Provider "Options MultiViews" überhaupt zuläßt.

Diese beiden Dateien sollten auch nicht fehlen im Testverzeichnis:

index.htm.de
index.htm.en

http://de.selfhtml.org/...#alternative_inhalte

Unter der obigen URL findest Du noch zwei Beispiele (2 und 3), die ohne "Options MultiViews" funktionieren.


als Antwort auf: [#328853]

.htaccess multiviews

kontiki
Beiträge gesamt: 13

2. Jan 2008, 11:34
Beitrag # 3 von 7
Beitrag ID: #328866
Bewertung:
(8782 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo Sabine.

Du bist die Heldin 2008! :D
Wenn ich lediglich diese Zeile in der .htaccess-Datei einfüge und ich das gewöhnliche index.html weglasse, funktioniert es bei mir einwandfrei.

Danke 1000mal
kontiki


als Antwort auf: [#328859]

.htaccess multiviews

Urs Gamper
  
Beiträge gesamt: 4027

2. Jan 2008, 12:02
Beitrag # 4 von 7
Beitrag ID: #328869
Bewertung:
(8775 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo miteinander
Mich würde noch interessieren, wie dies getestet werden kann.
Ich müsste ja mein System auf englisch umstellen, damit ich schauen könnte, ober die Weiterleitung funktioniert? Oder welche Möglichkeiten habe ich da?
Grüessli
Urs


als Antwort auf: [#328866]

.htaccess multiviews

SabineP
Beiträge gesamt: 7586

2. Jan 2008, 12:26
Beitrag # 5 von 7
Beitrag ID: #328872
Bewertung:
(8762 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo Urs,

normalerweise reicht es aus, wenn Du die bevorzugte Sprache im Browser einstellst.
Bei jedem Zugriff auf eine Webseite sendet der Browser im Header diese Spracheinstellung an den Webserver.
Der Apache entscheidet nun welche Seite er an den Browser ausliefert.


als Antwort auf: [#328869]

.htaccess multiviews

kontiki
Beiträge gesamt: 13

3. Jan 2008, 12:24
Beitrag # 6 von 7
Beitrag ID: #329008
Bewertung:
(8708 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Noch eine Frage habe ich.

Da ich jetzt Dateien mit den Endungen .de und .en habe, öffnet Dreamweaver die Dateien nur noch in der Codeansicht. Ausser ich ändere es wieder auf die Endung .html

Gibt es eine möglichkeit, dass Dreamweaver ".de"- und ".en"-Endungen wie ".html"-Dateien behandelt?


als Antwort auf: [#328853]

.htaccess multiviews

ganesh
Beiträge gesamt: 1981

3. Jan 2008, 13:15
Beitrag # 7 von 7
Beitrag ID: #329020
Bewertung:
(8703 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Ja, das ist irgendwo tief in den Einstellungen drin... versuch mal dieses File zu ändern:

http://www.dwuser.com/dwuser/tutorials/dreamweaver-enhancements/change-default-file-extension-from-htm-to-html-dreamweaver-8/


als Antwort auf: [#329008]
X