Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Newbie Relinking old html files to new php files
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



Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bouchard
11-29-04 09:02 PM


Re: Newbie Relinking old html files to new php files
There 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
>



Report this thread to moderator Post Follow-up to this message
Old Post
Polaris
11-29-04 09:02 PM


Re: Newbie Relinking old html files to new php files
Dans 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



Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bouchard
11-29-04 09:02 PM


Re: Newbie Relinking old html files to new php files
>> 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



Report this thread to moderator Post Follow-up to this message
Old Post
Hilarion
11-29-04 09:02 PM


Re: Newbie Relinking old html files to new php files
Dans 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



Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bouchard
11-29-04 09:02 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:14 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.