TYPO3-Testaccount
Testen Sie die aktuellste TYPO3-Version kostenlos und unverbindlich für einen Monat!

Jetzt testen!

Schulungen

domain.de/821.0.html umleiten auf www.domain.de/821.0.html


Autor Nachricht
Verfasst am: 11. 03. 2010 [09:55]
actior
Themenersteller
Dabei seit: 29.05.2008
Beiträge: 7
Guten Tag,
um URLs ohne "www" also z.B. domain.de auf
www.domain.de umzuleiten funktioniert:

# in die .htaccess schreiben
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R01]

Möchte ich jedoch, dass alle bestimmten Seiten z.B.
domain.de/821.0.html auch auf www.domain.de/821.0.html
umgeleitet werden, dann klappt das nicht, man wird
immer auf index.php umgeleitet.

Hat jemand eine Idee?
Grüsse Uwe

P.S.
erreichen will ich dies eigentlich nur, weil sich auf besagter Seite ein javascript befindet mit der Zeile:
XMLHTTP.open("POST", "request.php", true);
und dies ohne "www" in der Domain nicht funktioniert.
Error: access denied
Profil
Verfasst am: 11. 03. 2010 [10:19]
just2b
TYPO3-Gott
Moderator
Dabei seit: 04.08.2004
Beiträge: 19047
Hallo,

und was hat das nochmal mit TS zu tun weil du die Kategorie benützt hast? Bitte beachten wohin du postest.

ansonsten sollte das helfen http://dmitry-dulepov.com/article/redirects-typo3-and-realurl-vs-mod-rewrite.html

lg

=> TYPO3 - inspiring people to share <= aber kein Support per PM!

=> in eigener Sache: · inspiring people to share your location Trag dich in die TYPO3 Weltkarte ein und zeige wie groß die TYPO3 Community ist - vielen Dank!<=
ProfilWWW
Verfasst am: 11. 03. 2010 [11:46]
kolki
Dabei seit: 04.08.2006
Beiträge: 719
Vielleicht so:
# Weiterleitung

RewriteEngine on
RewriteCond %{HTTP_HOST} domain.de/821.0.html [NC]
RewriteRule ^([^/]*)$ http://www.domain.de/821.0.html/$1 [R=301,L]
Löst das Dein Problem?

[Dieser Beitrag wurde 2mal bearbeitet, zuletzt am 11.03.2010 um 11:49.]
Profil
Verfasst am: 11. 03. 2010 [19:45]
actior
Themenersteller
Dabei seit: 29.05.2008
Beiträge: 7
Hallo just2b,
der Grund für die Wahl dieses Forums:
Bei der Suche "www umleiten" bin ich natürlich auf Ergebnisse gestossen, habe aber keine Antwort auf meine Frage gefunden. Dann stellte ich mir selbst die Frage in welches Forum? - und da das letzte Ergebnis welches ich anschaute in diesem Forum ist, dachte ich, ok, dann dieses.
Die Lösung meines Problems hätte evtl. ja auch mit TS möglich sein können?
Eigentlich möchte ich nur zum Ausdruck bringen, dass ich mir schon Gedanken gemacht habe und mich bei dieser Gelegenheit für das Forum bedanken.

Danke! für den hilfreichen Link.


Hallo Kolki,
danke für Deine Antwort, die leider nicht funktioinierte.

_________________________________________________________________
Zur Teillösung des Problems:
folgend die .htaccess Datei, darin die Erklärung warum es geht und warum es auch nicht geht, denn wenn ich die Typo3-.htaccess Datei erweitere an dem Ort wo man es machen soll, dann läuft es nicht, setze ich es direkt hinter

RewriteEngine On - dann läuft es.

Wird trotz des Setzens an die andere Stelle der Rest normal funktionieren?

Grüsse, Uwe




#php_value memory_limit 100M
#####
#
# 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

#---------------->>> setze ich es so hier funktioniert es
#---------------->>> Kolki, Deine Variante funktioniert auch hier nicht
RewriteCond %{HTTP_HOST} ^domain.de$
RewriteRule (.*) http://www.domain.de/$1 [L,R=301]




# 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 .0.html 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 ###

# Add your own rules here
# ...

#---------------->>> setze ich es hier funktioniert es nicht
#---------------->>> Kolki, Deine Variante funktioniert hier nicht
#RewriteCond %{HTTP_HOST} ^domain.de$
#RewriteRule (.*) http://www.domain.de/$1 [L,R=301]
Profil
Verfasst am: 05. 07. 2010 [11:53]
Parker
Dabei seit: 08.05.2009
Beiträge: 26
Hallo actior,
so wie ich Deine Frage verstehe, würde ich die .htaccess wie folgt schreiben:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
RewriteCond %{HTTP_HOST} !^www.MyDomainForAll.de [NC]
RewriteRule .* http://www.MyDomainForAll.de%{REQUEST_URI} [R=301,L]

Gruß
Parker
Profil
Verfasst am: 13. 07. 2010 [17:16]
iAL
Dabei seit: 13.07.2010
Beiträge: 12
Hallo!

warum nicht so? Im t3 BE:

"Neu" auf startseite, Domain anlegen, 2.te Domain anlegen und auf erste verlinken mit bzw. ohne www.

Gruß Chris

Internetagentur Ludwigsburg
Ihr Partner für Content Management Systeme (CMS), Programmierung, NewMedia, Web 2.0 und Webdesign mit dem besonderen Service im Raum Stuttgart und Ludwigsburg in Baden-Württemberg.
http://www.internetagentur-ludwigsburg.de
ProfilWWW
Verfasst am: 13. 07. 2010 [18:03]
Parker
Dabei seit: 08.05.2009
Beiträge: 26
Vielen Dank für Eure Unterstützung!

Ich habe die Lösung, wie gewünscht, mit einem COA-Objekt und einem typolink dem Menü hinzugeführt bekommen.
Profil