Would Apache as default be able to notice:
<script language='php' type="text/???"> echo '<p>Can U see me?</p>'; </script>
This would simplify installing widgets generally. I am borrowing from the JavaScript idea.
Renaming *.html to *.php
Moderator: General Moderators
Re: Renaming *.html to *.php
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP
Re: Renaming *.html to *.php
Thanks for the clarification. I have since added JSP to the mess to see if I can figure out that as well.scottayy wrote:There's a bunch of crap in this topic, LOL. Well not necessarily crap, but just beating around the bush.
Just rename your .html extensions to .php extensions and you can put php code in any of them.Simple.
Don't worry about the .htaccess part, or search engine ranking.
I've had fairly busy web sites (upwards of 200,000 page loads per day) on a pretty normal server and server load never became a problem. I've also had .php pages rank well (and yes, in google).
Keep it simple.
The way I see it now, old documents are HTML, new active ones will be PHP or JSP as needed. Only recently been working more with Linux and active content. Seems to be a lot to learn.
I prefer the simplest solutions as they tend to be adequate. My sites are nowhere near that busy but some day? I wish.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP
Re: Renaming *.html to *.php
There is a way to get around the problem of broken links caused by making structural changes to your website (like changing all .html extensions to .php or moving files to different folders). In your 404 page (ex: missing.php), create a script that analyzes the incoming REQUEST_URI and tries to match it with an existing file. If a match is found, redirect to the matched page.
Edit: This post was recovered from search engine cache.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Mon Jun 14, 2010 11:15 am, edited 1 time in total.
Re: Renaming *.html to *.php
This is a little confusing to follow.
But a quick solution is to just go like this:
Kinda messy but can get the job done.
Then, if you are using a shared host, the php will be parsed inside html if there are <?php and ?> tags.
But a quick solution is to just go like this:
Code: Select all
<?php
$randomly_generated_number = rand(1,3);
switch ($randomly_generated_number) {
case 1:?>
<some><html></here>
<?php
break;
case 2:?>
<some><other><html></here>
<?php
break;
case 3:?>
<some><another><html></here>
<?php
}
?>
Then, if you are using a shared host, the php will be parsed inside html if there are <?php and ?> tags.