Einzelnen Beitrag anzeigen

H3llsing

Registriert seit: 12. Nov 2008
96 Beiträge
 
Delphi 2010 Enterprise
 
#6

AW: Wie Funktioniert eine Automatische Weiterleitung?

  Alt 13. Aug 2010, 08:25
Gibts eigentlich noch andere möglichkeiten der WWW umleitung ?
also von der adresse domain.de nach www.domain.de ?!

folgendes funktioniert leider nicht da meine Page auf nem Windows server mit IIS liegt.

Zitat:
Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.


momentan hab ichs unschön mit PHP gelöst

Code:
  $url = "$_SERVER[HTTP_HOST]";
  $urlPraefix = substr($url,0,3);
  if($urlPraefix != "www"){
  echo "<meta http-equiv='refresh' content='0; url=http://www.domain.de$_SERVER[REQUEST_URI]'>";
  Mit Zitat antworten Zitat