Forum Moderators: phranque

Message Too Old, No Replies

shtml parsing php

would that be a problem?

         

Majinboo

1:57 pm on Nov 16, 2004 (gmt 0)

10+ Year Member



I have several shtml files that I want to use PHP includes, adTrackers and applications so, if I set the server like:

[b]AddType application/x-httpd-php .shtml[/b]

Would that impose a problem on the server, conflicting, maybe overloading or it doesn't matter? It's a small website with low traffic, about 100 pages and 2k to 3k visits month.

Thanks

coopster

2:10 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Majinboo.

I have had to incorporate this for some folks and have done so without performance issues. Ideally, I would rather use PHP for server-side includes, but in some cases an Apache SSI was quicker and what the job called for.

You can also run SSI in .php files

# Uncomment the following if not already allowed: 
#Options +Includes
AddOutputFilter INCLUDES .php

Majinboo

2:50 pm on Nov 16, 2004 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld, Majinboo

Thanks :)

You can also run SSI in .php files

# Uncomment the following if not already allowed: #Options +Includes AddOutputFilter INCLUDES .php

Great! I will do it.

Btw, do you know any good place gathering info about .htaccess in a comprehensible manner? Something on a relatively easy language. I know I can find pretty much everything here but it's quite spreaded and turns out to be time consuming for me sometimes since I don't know much about.

coopster

4:33 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. The Apache Tutorial: .htaccess files [httpd.apache.org] isn't too bad, have you read that yet?

Majinboo

5:16 pm on Nov 16, 2004 (gmt 0)

10+ Year Member



The Apache Tutorial: .htaccess files isn't too bad, have you read that yet?

Actually no, I'm going to do it, I really need to learn this. When I asked first about setting the server I forgot to say that would be through an htaccess file.

PROBLEM: (back to first question) I just tested

AddType application/x-httpd-php .shtml

with a test.shtml which has a bit of php into: fisrt used an include on a regular file then, after an error, tried a clean file with just a "echo" but my browser get stucked on a loop, Firefox keeps opening new windows (and me hitting alt+F4 like crazy) while IE ask if I want to DL test.shtml

Any idea how I can fix it? These shtml pages being indexed for a couple of years now so I don't want to switch to php extension.

coopster

6:54 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Why not create a separate directory (test) and plop a simple file in there with an .shtml extension? Put in some simple html, an SSI, and a simple php statement, as you suggested. Maybe just echo something for now.

Then drop your .htaccess file in that directory and see if you get any errors when you open the file in your browser and troubleshoot back from there.