.htaccess

Apache, Lighttpd, nginx, Cherokee
Post Reply
highquality
Posts: 20
Joined: 2004-03-29 14:06
 

.htaccess

Post by highquality »

Hallo,

was genau muss in der .htaccess drin stehen das meine index.html php-Code parsen kann? Ich habe schon alles möglich auspropiert.

in meiner index.html steht folgendes:

<?php
... php-code ....
?>
<html>
<head>
<title>--->>>></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script LANGUAGE="JavaScript">
top.location.href='http://www.domain.de
</script>

</head>

<body>
TEST
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="Text/Javascript">
... javascript

</SCRIPT>
</body>

Versucht habe ich folgendes:

AddType application/x-httpd-php php php4 php3 html htm

Da dachte ich, es geht ohne Probleme, nur die eigendliche Seite wird nicht angezeigt bzw. es wird nicht auf die eigentliche Website weitergeleitet.

Bei einem anderen Versuch wurde ich aufgefordert die Website local zu speichern... ;(

Kann mir jemand weiterhelfen?

Gruß hQ
</html>
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: .htaccess

Post by r00ty »

probier mal

Code: Select all

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddHandler x-httpd-php .htm
AddHandler x-httpd-php .html
highquality
Posts: 20
Joined: 2004-03-29 14:06
 

Re: .htaccess

Post by highquality »

Hi,

ich habe jetzt in meiner .htaccess folgendes stehen:

AddType x-mapp-php4 .htm
AddType x-mapp-php4 .html

in meiner index.html steht folgendes:

<?php


$absolutepath = "/home/htdocs/web10002/html/statistik";

include($absolutepath."/logit.php");

include($absolutepath."/trackit.php");

include($absolutepath."/datatransfer.php");

include($absolutepath."/includes/useronline.inc.php");

$bstatfilename = trim(ereg_replace ("\\","/",__FILE__));



logit("www.webxxxx.de", "2126339296"); // save visitor

trackit("www.webxxxx.de", "2126339296"); // save visitor movement

usercount("www.webxxxx.de", "2126339296"); // save useronline-number

savefilesize("www.webxxxx.de", "2126339296", $bstatfilename); // save filesize



?>
<html>
<head>
<title>webspacekeeper.de</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" onLoad="MM_goToURL('parent','http://www.webxxxx.de');return document.MM_returnValue">
Du wirst gleich weitergeleitet, sollte Ihr Browser dies nicht unterstützen,
einfach <a href="http://www.webxxxx.de">hier klicken</a>


<SCRIPT LANGUAGE="JavaScript1.2" TYPE="Text/Javascript">
<!--
var sitename = "www.webxxxx.de";
var installdir = "http://logfiles.webxxx.de";
document.write('<SCRIPT LANGUAGE="JavaScript1.2" TYPE="Text/Javascript" SRC="' + installdir + '/scripts/logitjavascript.js?sitename=' + sitename + '&installdir=' + installdir + '&dummy=' + (new Date()).getTime() + '"></SCRIPT>')
//-->
</SCRIPT>



</body>
</html>


das ergebnis ist das jetzt die weiterleitung nicht funktioniert weil aufeinmal im quelltext nur noch das steht:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD>
<BODY></BODY></HTML>

Ja, wo ist den mein Code?

Gruß Stefan
simcen
Posts: 333
Joined: 2003-02-12 14:35
Location: Bern, Schweiz
Contact:
 

Re: .htaccess

Post by simcen »

RewriteEngine ON
RewriteRule ^index.html$ index.php [QSA,L]

Das in die .htaccess Datei.
highquality
Posts: 20
Joined: 2004-03-29 14:06
 

Re: .htaccess

Post by highquality »

... hatte leider auch keine auswirkung .... ich verstehe das ganze nicht!
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: .htaccess

Post by r00ty »

bist du dir sicher dass es
x-mapp-php4
ist ?
poste am besten mal deine httpd.conf (aber bitte ohne Kommentare)
cweckmann
Posts: 30
Joined: 2004-07-01 08:18
Contact:
 

Re: .htaccess

Post by cweckmann »

Ã?m... muss nicht, damit der PHP-Parser drüber geht die datei index.php anstatt indes.html heißen? :?
ryukia
Posts: 58
Joined: 2004-07-16 14:40
Location: Karlsruhe
 

Re: .htaccess

Post by ryukia »

Hi,

Probiers mal wie hier beschrieben: http://www.desilva.biz/php/phpinhtml.html

also

Code: Select all

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
in die .htaccess

Ciao
Ryukia
Post Reply