Forum Moderators: phranque

Message Too Old, No Replies

.htaccess parsing html as php for specific file

         

mangotude

3:30 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



I get the feeling the answer to this is 'no' but I wanted to check with people who have a clue :)

i wanted to parse some php code in an html page. i tested .htaccess with the following


AddType application/x-httpd-php .html

this works fine.

is there a way (in .htaccess or .conf files) to specify what URLs would be parsed - so - e.g.

apache.html and widget.html

would be parsed for php and the rest kept?

any advice gratefully received

jdMorgan

4:16 pm on Apr 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could rename those files to .php, and then use mod_rewrite to internally rewrite the .html version of those specific URLs to the .php version, and then parse only the .php files.

Jim

mangotude

5:50 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



Thanks Jim, I hadn't thought of approaching it that way.

James