Code Comments
Programming Forum and web based access to our favorite programming groups.I am new to PHP and learning. On my web site, all my files have the html extension. In the near future, I want to dynamically generate them by using PHP. In doing so, for example, my index.html file will become index.php. This will affect visitors linking to my site using old index.html. Is it possible to use .htaccess to correct this problem and how is it done? Thanks. --- Ce courriel est exempt de virus. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-16
Post Follow-up to this messageThere is a very simple workaround for this... Give index.html the following code: <html> <head> <meta http-equiv="refresh" content="0; url=index.php"> </head> <body> </body> </html> It will directly go to index.php and you don't have to warn anybody. Polaris. "Pascal Bouchard" <forum@mitan.ca> schreef in bericht news:3pbqd.44025$i_4.2137936@weber.videotron.net... >I am new to PHP and learning. On my web site, all my files have the html >extension. In the near future, I want to dynamically generate them by using >PHP. In doing so, for example, my index.html file will become index.php. >This will affect visitors linking to my site using old index.html. Is it >possible to use .htaccess to correct this problem and how is it done? > Thanks. > > > --- > Ce courriel est exempt de virus. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-16 >
Post Follow-up to this messageDans un message précédent, Polaris <ask4polaris@hotmail.com> a écrit: > Give index.html the following code: > > <html> > <head> > <meta http-equiv="refresh" content="0; url=index.php"> > </head> > <body> > </body> > </html> > > It will directly go to index.php and you don't have to warn anybody. > Hum... I cannot use that because my index.html will be no more at the root of my server, having been replaced by index.php. Will my visitors linking to the (now gone) index.html get a 404 error? How to avoid that and have the index.php take over? Thanks! --- Ce courriel est exempt de virus. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-17
Post Follow-up to this message>> Give index.html the following code: > Hum... I cannot use that because my index.html will be no more at the root of my s erver, having been replaced by index.php. So create "index.html" file with above code. It'll only redirect users to "index.php" file. You may also use mod_rewrite of apache (if you are using one) to change html extensions to php extensions in URLs. Hilarion
Post Follow-up to this messageDans un message précédent, Hilarion <hilarion@SPAM.op.SMIECI.pl> a écrit: > So create "index.html" file with above code. It'll only redirect > users to "index.php" file. > Understand! This "index.html" file will only contain the redirect code to "index.php". Fine. > You may also use mod_rewrite of apache (if you are using one) to > change html extensions to php extensions in URLs. > My Web site is on a apache server. Another newbie question: Before using the elegant "index.html" solution above or the extreme mod_rewrite one, do the apache servers make a difference between .html or .php extensions i.e. if presented with the request of "index.html", the server would automatically, by default, send "index.php" if this is the only file available? Many thanks again to all! Pascal. --- Ce courriel est exempt de virus. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-18
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.