user3262732
user3262732

Reputation: 256

run htm file as php using htaccess

I have few files whose extension is htm that i want to run as php using htaccess code

this is the htaccess code that i am using

AddHandler application/x-httpd-php5 .htm .php .html

this code work fine but now i change my hosting server in that this code not working.

i tried all these code but no one work

AddHandler application/x-httpd-php .htm .php .html

AddType application/x-httpd-php .html .htm

AddType application/x-httpd-php5 .html .htm

my new server says

cPanel Linux Hosting packages only support the SymLinksIfOwnerMatch option in the .htaccess file.

Please point me in right direction how can i run htm file as php on my server

Upvotes: 0

Views: 369

Answers (1)

giorgio
giorgio

Reputation: 10212

I'm afraid it's a no-go then... If your hosting blocks the appropriate directives in your .htaccess, your only way to go would be to either blackmail or hack the provider, or change the extension from .htm to .php. As this is really a server-administration thing, and if the server administrator doesn't allow you, there is no way you can go around it...

A hacky solution would be to use rewrites to route .htm to .php files. But still then you'd need to rename your files from .htm to .php. This could be a solution if you're app routing isn't setup dynamically and your main concern is that the url's should not be changed. Although changed url's can be caught with 301 redirects.

Upvotes: 1

Related Questions