Forum Moderators: coopster

Message Too Old, No Replies

Redirecting pages

         

turbohost

12:16 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



Hi Guys,

I ran into a bit of a problem. I'm trying to build a dynamic website on an iis webserver via php and mysql.

I'm sending all my 404 error pages to a php file. In this file I parse the url and load the appropriate html code to launch the html page. If the url does not exist the visitor will be redirected to the homepage. Now the problem : When I redirect to the php redirect file it shows up as plain text. I'm not familiar with iis, only with apache. Can somebody help me?

Turbo

hughie

12:23 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



the PHP is showing as plain text?

i.e. instead of it executing the code your getting
<?php
mycode;
?> etc.

If so, PHP is not being executed by your webserver.
Is there a reason why your using IIS and not apache?

mcibor

12:40 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe if your normal pages have *.php and your redirect page has 404.html you're not parsing any html files?

If so, then you should add html files to parsing through php.

On IIS I'm not sure how to do this, but on Apache in httpd.conf you need to add
AddType application/x-httpd-php .php .html

Sorry for not a straight-forward answer.
Best wishes on the coming New Year!

turbohost

1:02 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



Hi Hughie,

At work I use iis, at home apache :->

It's strange. PHP as well as html show up fine. It's only the redirect.php file which shows up in clear text (i.e. like <?php code?>)

Best wishes for the New Year

Turbo

hughie

2:29 pm on Dec 30, 2004 (gmt 0)

10+ Year Member



thats an odd one but getting IIS to parse HTML files the same as php would seem to be the answer.

Cheers,
hughie