 |

09-02-2005, 12:28 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
|
|
HTML parse as PHP using .htaccess problem
I am running on a Unix server and have been able to add the following lines to my .htaccess file in the past to parse HTML as PHP.
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
On this particular server adding these lines does not work. In fact, it makes my index.html page try to download to the harddrive and any other .htm pages do not parse the php code.
Has anyone run across this problem? Is there a solution?
Thanks,
Rich
|

09-02-2005, 12:50 PM
|
|
WebProWorld Pro
|
|
Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
|
|
Try it as a single line like:
AddType application/x-httpd-php .php .htm .html
Does everything work as it should when you remove the .htaccess file?
Have you checked the httpd.conf file for anything that might put a kink in things? The host may have it configured to not allow overides.
__________________
:not_the_usual1
[you decide]
________________
All in my opinion, which, when combined carefully with a $1 bill, gets you a cup of coffee at the corner store.
|

09-02-2005, 01:00 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
|
|
I tried the single line also. When I remove it, the website works fine other than the htm pages to do not parse.
How do I access the httpd.conf file?
Rich
|

09-02-2005, 01:06 PM
|
|
WebProWorld Pro
|
|
Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
|
|
That's usually a hosting thing - unless you have root access to the server.
If you've never done .conf files before, you would be much better off having an experienced admin work through this with you - when you describe the problem, they'll know right where to look and what needs done (on either end).
__________________
:not_the_usual1
[you decide]
________________
All in my opinion, which, when combined carefully with a $1 bill, gets you a cup of coffee at the corner store.
|

09-02-2005, 01:40 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
|
|
My server provider isn't being much help...
So, new question...
How do I quickly change all my file extentions to PHP? I have hundreds of files so I would like to do a batch process but do not know where to start.
I use Dreamweaver MX if that helps.
Rich
|

09-02-2005, 03:17 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
|
|
Here is what my host said:
"Please check apache2 specific documentation. Your other sites are running on old type linux of servers."
So, using apache2, how do I make my htm and html files parse as PHP.
Thanks,
Rich
|

09-02-2005, 04:52 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
|
|
I fixed my problem.
Good old CMD prompt command:
rename *.htm *.php
rename *.html *.php
And then I did a find and replace in Dreamweaver, site wide:
FIND: .htm REPLACE: .php
FIND: .html REPLACE: .php
Rich
|

09-02-2005, 05:56 PM
|
|
WebProWorld Pro
|
|
Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
|
|
sorry for the lack of response - I had to mow the yard before it got dark - very glad to hear that you solved your problem.
I was going to ask about the .html extensions on your PHP pages but thought you might have known something I didn't.....
Have a great weekend.
__________________
:not_the_usual1
[you decide]
________________
All in my opinion, which, when combined carefully with a $1 bill, gets you a cup of coffee at the corner store.
|

09-02-2005, 06:12 PM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Sep 2003
Location: Texas
Posts: 1,283
|
|
Rich, this may not be an issue with the site you're working on, but the new ".php" pages will be seen as brand-new pages by the SEs. All the new pages will have 0 PR and any links to the old pages will now result in a 404.
Again, this may not be an issue for you in this case, but in case someone comes and reads this later, if you take this route and you want to maintain your SERPs, you should create a 301 from the old filenames to the new ones.
|

09-02-2005, 07:07 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
|
|
Quote:
|
Originally Posted by flood6
Rich, this may not be an issue with the site you're working on, but the new ".php" pages will be seen as brand-new pages by the SEs. All the new pages will have 0 PR and any links to the old pages will now result in a 404.
Again, this may not be an issue for you in this case, but in case someone comes and reads this later, if you take this route and you want to maintain your SERPs, you should create a 301 from the old filenames to the new ones.
|
Excellent point.
__________________
DrTandem's San Diego Web Page Design, drtandem.com
|

09-03-2005, 10:10 AM
|
|
WebProWorld Veteran
|
|
Join Date: Oct 2004
Posts: 437
|
|
Why don't you try this?
AddHandler php-script .html
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|