Forum Moderators: phranque
I'm moving a site over to a new server (from static to php pages), so it's extremely important for me to catch links that may not have been updated.
My provider for the existing site was not willing to work with me to solve the problem. I would like to get ideas from the gurus here before contacting support for the new provider.
I've been through many of the "Internal Server Error" and other search results, have found many good ideas unrelated to my current problem, but didn't find anything specific on my issue.
My .htaccess file contains only the following 2 lines:
ErrorDocument 404 /files/error404.php (this works)
ErrorDocument 500 /files/error500.php (this does nothing)
As stated previously, the error404.php file does come up as expected with bogus.htm.
info for the new server:
Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.26 PHP/4.3.3
Bill
AddType application/x-httpd-php .htm .html
That will make the server run all your old pages using the htm or html extension but process all the php on the page, and you won't lose any pages, no 404's from the change, old links to your site will still work, etc.
There were major changes to the old site. Biggest: no more frames! Also changes were made to page names, image names. The site is ready to go and appears to be working fine.
I would just like my 404 custom error page to come up on a bad link or incorrectly type url.
One of my servers handles it just fine, the other one (the reason for my post) does not:
Trying looking for bogus.php on both to see what I mean.
[edited by: jdMorgan at 12:15 am (utc) on Feb. 1, 2004]
[edit reason] No personal URLs, please see TOS. [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
If you have access to it, checking your server error log file after a 500-Server Error should tell you what or where the problem is.
Jim
I added: AddType application/x-httpd-php .htm .html
to the .htaccess file on 2 servers below (we'll call them Server 1 and Server 2).
Server 1 (it works):
Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6g PHP/4.1.2 mod_perl/1.26
http://www.example.com/sshots006/test/test1.htm
Server 2 (doesn't work):
Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.26 PHP/4.3.3 FrontPage/5.0.2 mod_ssl/2.8.12 OpenSSL/0.9.6b
http:[]b[/b]//www.example2.com/test/test2.htm
Same file with php extension works:
http://www.example2.com/test/test2.php
(Server info comes from phpInfo() > Environment > SERVER_SOFTWARE)
Server 1 parses the php code in the htm file.
This server also gives 404 error on non-existent php page.
Server 2 does not parse and the php code in visible in the source.
This server gives Internal Server Error on non-existent php page, but brings up my 404 page on htm files (which tells me that it reads my htaccess file).
Server 2's behavior is EXACTLY SIMILAR to another server I use... totally different provider.
Server 3:
Apache/1.3.26 (Unix) PHP/4.1.2 FrontPage/5.0.2.2510
(Gives Internal Server Error and the AddType to parse php in an htm page does not work.)
* So I don't know what to do, other than go with php extensions (so php gets parsed).
* Live with the Internal Server Errors (not knowing where the errors are coming from).
I'm hoping someone knows what's going on here.
[edited by: jdMorgan at 10:12 pm (utc) on Feb. 1, 2004]
[edit reason] Removed URLs per TOS. [/edit]