View php files as another filetype?

itman647

New Member
Messages
45
Reaction score
0
Points
0
I've been looking for this all day, and I have tried many times to add

AddType application/x-httpd-php .aspx .html .php
ForceType application/x-httpd-php
DefaultType application/x-httpd-php
SetHandler application/x-httpd-php
Add Handler application/x-httpd-php

to the lines of my .htaccess file but its either resulted in a 500 Internal Server Error page or a forced download of the page lol

I've tried all of them in different combinations and now its driving my crazy lol :rant2:

I'm just wondering is it anything to do with access to certain parts of the server? Because I saw something on the internet called mod_rewrite or something that was related to this and it had something to do with the php.ini file, I cant find the php.ini file? Is it because that ini file determines what php configuration your account has and if you edit it you could prob seriously **** up the server or something? I dunno but anyway all I want to do is run .aspx as a php file.

P.S my hosting package is FREE, I dont know if that would make a difference?

Please help :tear:
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
anyway all I want to do is run .aspx as a php file.
PHP is a programming language.
ASP is a framework to run certain programming languages.

If you tried to run code designed for aspx, the compiler will find nothing but errors. Most of them due to the fact that the code isn't PHP...
Surprisingly enough, the PHP interpreter can only interpret PHP.

Why not just run it as ASP, which you already have?


I may have misunderstood your point though. Read this topic (asp.net forums) and see if it helps?
 

itman647

New Member
Messages
45
Reaction score
0
Points
0
not just for asp tho, what i really need is a way to run a php programmed page under different or even not-existing extensions like instead of my main index page being index.php i want it to be renamed to index.abcd but still run as a php page?
 
Last edited:

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
Ah, now I know what you mean. You want PHP to parse pages with different extensions!

.htaccess is your friend here.
Code:
AddType application/x-httpd-php .html .aspx .htm
That should work for html/htm/aspx pages. If not, it's a X10 issue. Make the .htaccess in the same folder as the files you want to use with it.
 

itman647

New Member
Messages
45
Reaction score
0
Points
0
it still doesn't work, I think it might be something to do with the php.ini file or sumthing. because when i type into the url index.aspx it comes up as a download. and the htaccess file is in the same directory as it and with the line AddType application/x-httpd-php .html .aspx .htm inside it. I dunno what to do? Should I contact x10hosting? Maybe they need change permissions or something?

When I look at the source code for the index.htm file, it comes up with my php coding at the top but has not outputted it as php instead its outputted it as html but does not appear in the page, only in the source code.

UPDATE
I've figured out the problem its the format of the php file
I checked the headers using the <?php phpinfo(); ?> function and the page was outputted to the browser as application/x-httpd-phpv2. LOL thanks to everyone that tried to help me out.

AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
not
AddType application/x-httpd-php .aspx .mgl. .psx .htm

- itman647
 
Last edited:

hezuo

New Member
Messages
174
Reaction score
0
Points
0
UPDATE
I've figured out the problem its the format of the php file
I checked the headers using the <?php phpinfo(); ?> function and the page was outputted to the browser as application/x-httpd-phpv2. LOL thanks to everyone that tried to help me out.

AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
not
AddType application/x-httpd-php .aspx .mgl. .psx .htm

- itman647

Thanks a lot man! You really help me!! but I think it would be better if they add the .html too, like here:

AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm .html
 
Last edited:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
Code:
AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
is what itman did. x10, or any other host, does not have .htm(l) parsed as php due to the fact that it wastes valuable server resources, because not everyone has .html files with php code inside, but they have just plain html.

but it's nice to know that they use a different application-type on the servers (v2) (which is probably the php levels if i had to guess).
 
Top