WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-02-2005, 12:28 PM
richkoi's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default 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
Reply With Quote
  #2 (permalink)  
Old 09-02-2005, 12:50 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
nottheusual1 RepRank 0
Default

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.
Reply With Quote
  #3 (permalink)  
Old 09-02-2005, 01:00 PM
richkoi's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

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
Reply With Quote
  #4 (permalink)  
Old 09-02-2005, 01:06 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
nottheusual1 RepRank 0
Default

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.
Reply With Quote
  #5 (permalink)  
Old 09-02-2005, 01:40 PM
richkoi's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

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
Reply With Quote
  #6 (permalink)  
Old 09-02-2005, 03:17 PM
richkoi's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

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
Reply With Quote
  #7 (permalink)  
Old 09-02-2005, 04:52 PM
richkoi's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

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
Reply With Quote
  #8 (permalink)  
Old 09-02-2005, 05:56 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 234
nottheusual1 RepRank 0
Default

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.
Reply With Quote
  #9 (permalink)  
Old 09-02-2005, 06:12 PM
WebProWorld 1,000+ Club
 

Join Date: Sep 2003
Location: Texas
Posts: 1,283
flood6 RepRank 0
Default

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.
Reply With Quote
  #10 (permalink)  
Old 09-02-2005, 07:07 PM
DrTandem1's Avatar
WebProWorld 1,000+ Club
 

Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
DrTandem1 RepRank 2
Default

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
Reply With Quote
  #11 (permalink)  
Old 09-03-2005, 10:10 AM
WebProWorld Veteran
 

Join Date: Oct 2004
Posts: 437
wednesday RepRank 0
Default

Why don't you try this?

AddHandler php-script .html
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Tags: , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0