Weiterleitung http://domain.com auf http://www.domain.com

Apache, Lighttpd, nginx, Cherokee
Post Reply
lucideye
Posts: 12
Joined: 2002-10-20 22:58
 

Weiterleitung http://domain.com auf http://www.domain.com

Post by lucideye »

Hallo,

Wollte mal fragen, wie man am besten http://domain.com/.*? auf http://www.domain.com/$1 umleitet. Also so, wie auch hier im Forum.
teddybear
Posts: 5
Joined: 2003-10-10 21:26
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by teddybear »

Per PHP Script:

Code: Select all

<?php header ("Location: http://deinziel.tld/subdir"); exit; ?>  

Waere das z.B. moeglich einfach als index.php speichern und in das Root dir von domain.tld legen.

Brummige Gruesse

Teddy
lucideye
Posts: 12
Joined: 2002-10-20 22:58
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by lucideye »

Hi,

Ist leider keine Lösung.
Ersteinmal laufen Aufrufe á la http://domain.com/subdir/, etc. normalerweise nicht über /index.php, zweitens dachte ich da eher an etwas über .htaccess.

Trotzdem danke.
teddybear
Posts: 5
Joined: 2003-10-10 21:26
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by teddybear »

Hm- Verstehe ich richtig das z.B.

http://blablabla.de nur nach http://www.blablabla.de weitergeleitet werden soll?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Weiterleitung http://domain.com auf http://www.domain.co

Post by Joe User »

Lucideye wrote:Wollte mal fragen, wie man am besten http://domain.com/.*? auf http://www.domain.com/$1 umleitet.
mod_rewrite
lucideye
Posts: 12
Joined: 2002-10-20 22:58
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by lucideye »

TeddyBear wrote:Hm- Verstehe ich richtig das z.B.

http://blablabla.de nur nach http://www.blablabla.de weitergeleitet werden soll?
Ja, aber nicht nur.
So wie auch hier im Forum, inklusive des gesamte Pfades.

Klick doch mal:
http://www.rootforum.org/forum/viewtopic.php?t=17850

wird weitergeleitet auf:
http://www.rootforum.org/forum/viewtopic.php?t=17850
lucideye
Posts: 12
Joined: 2002-10-20 22:58
 

Re: Weiterleitung http://domain.com auf http://www.domain.co

Post by lucideye »

Joe User wrote:
Lucideye wrote:Wollte mal fragen, wie man am besten http://domain.com/.*? auf http://www.domain.com/$1 umleitet.
mod_rewrite
Ich will ja nicht umschreiben, ich will einen 301-Redirect.
wirsing
Posts: 604
Joined: 2002-11-20 21:32
Location: Vaihingen und Karlsruhe
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by wirsing »

Geht auch mit mod_rewrite. [R]
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by Joe User »

bitte selbst anpassen:

Code: Select all

RewriteEngine On
RewriteCond %{REQUEST_URI} ^{.*}.html$
RewriteRule ^(.*).html$ /$1.xhtml [R=301,L]
lucideye
Posts: 12
Joined: 2002-10-20 22:58
 

Re: Weiterleitung http://domain.com auf http://www.domain.com

Post by lucideye »

Joe User wrote:bitte selbst anpassen:

Code: Select all

RewriteEngine On
RewriteCond %{REQUEST_URI} ^{.*}.html$
RewriteRule ^(.*).html$ /$1.xhtml [R=301,L]
Jo, super. Danke.

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1?%{QUERY_STRING} [R=permanent,L]
Post Reply