Forum Moderators: coopster

Message Too Old, No Replies

HTML works same as PHP

whats happening

         

blue_eagle

3:46 am on Aug 29, 2005 (gmt 0)

10+ Year Member



If this question has been asked before I am really sorry. but right now i am really amazed since I see all my html files work as same as php files. I use bunch if include codes on my pages and therefore i use php to make the server recognize. First I create the file as html file and I convert it to php and thats how the server reads.
If there is only html file uploaded it was not reading the include files and all the include sections used to be blank since it is html.

Couple mins ago i was trying something and i saw that html files read as same php. widget.html is same widget.php and even more interesting if you want to reach the content from widget.html it goes to widget.html?subaction=etc.etc. it used to widget.php?subaction-etc.etc.

Is this normal? was I sleeping when this thing came out ages ago? Last time about coupke months ago there wasn;t such thing and now I am really surprised, I would appreciate if anyone can comment on this.

Thanks..

omoutop

6:12 am on Aug 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi!

it is not possible to happen byitself, search your root directory ans subdirectories for an .htaccess file, wht u describe can only be made by using .htaccess and mod rewrite, as long as I know...

hope it helps.

coopster

5:36 pm on Aug 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



To clarify, are you saying that your files that end in ".html" are being parsed as though they were ".php" files? If so, then omoutop is correct in that this doesn't just happen by itself. It certainly sounds like a configuration adjustment has been made.

blue_eagle

8:16 am on Aug 30, 2005 (gmt 0)

10+ Year Member



thanks guys,

yea i remember now that, i was trying to do some stuff with.htaccess file and probably thats why it happened. So if i leave it like that will it be better for Search engines?

Thanks..

omoutop

8:21 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As long as I know there are 2 ways solving ur problem using htaccess...

Use htaccess rules to redirect pages and use robots.txt to disallow spiders and bots for the original files...
or just using htaccess alone with [301, L] redirections without the need or robots.txt....

If u dont understand I can clarify it for u....i can present u some details...

abbeyvet

8:30 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So if i leave it like that will it be better for Search engines?

If you mean will search engine prefer .html pages, then no, search engines do not care about the extension at all.

Mr_Fern

8:54 am on Aug 30, 2005 (gmt 0)

10+ Year Member



If you wish to hide the language being used from visitors by using the html extension then I suppose that works, but the downside of using .html for php pages, all html files get parsed by PHP, regardless of whether they have php programming or not. This means nothing on a low load server / low traffic site, but it adds up when you're high volume or the server's heavily loaded.

grandpa

9:50 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Good point Mr_Fern. A lot of my php pages could easily be simple html documents, but I add php code for tracking and sessions. My server load is not an issue today.

So if i leave it like that will it be better for Search engines?

All of my php pages use mod rewrite in htaccess. I don't do it for search engines or SEO, but because most users are familiar with html pages.. so that's what they get. One small caveat, with some scripts that post to self the php extension may appear in the URI. To overcome that I hard code the post action to the html filename instead of using action="<?php echo $_SERVER['PHP_SELF'];?>"