Jump to content

Recommended Posts

Posted

i tried it out.

but i can't see any .htaccess file in heliohost.

Even if i upload one,it doesn't show up.

anyway,thanx for ur help.

Posted

you could try asking in the customer service forum about .htaccess...i'm not sure what djbob has allowed...but what exactly do u need that for? theres probably other ways of doing it too

Posted

All you do to put php in a page is name it page.php

then put the php in the html document

EX

<html>
<head>
</head>
<body>
<?php
switch (rand(1 4)) {
case 1;
echo"we strive to help you!";
break;
case 2;
echo "Please check out our hosting forum.";
break;
case 4;
echo"We are now taking aplications.";
break;
}
?>

I think that is right for the most part.

 

Joe

 

Posted

To use php I think that you have to make it a .php page, but I'm not sure about that. You can still put html in the .php page.

Look up a good tut on php.

Posted

looking at my files again, it's really obvious that you CAN edit the .htaccess file...I use FileZilla, and after connecting to HelioHost I went to the folder public_html and the .htaccess file should be there...download it, edit it like that website says, and upload it again.

 

i just checked using the cPanel, and you can't see it from there. i don't know about what RK Web Designs said, but I didn't do anything special except connect using an FTP client (such as FileZilla - google it, its free)

 

i think you're checking through the cPanel, and it doesn't show up there. am i correct?

Posted

.htaccess is a hidden file by default, if your using helio click on file manager and select show hidden files ;)

Posted
.htaccess is a hidden file by default, if your using helio click on file manager and select show hidden files ;)

 

All files starting with a . are hidden files by default on Linux/Unix hosts.

Also for .htaccess to work it needs to be permitted in Apache's configuration file.

 

 

I don't really know why you would want to do what your doing though.

 

All that site does is tell the webserver anything ending in .html or .htm is a PHP file and should be treated as a PHP file.

You may aswell have used a .php file

 

What is normally more useful is to do that with a JPEG extension then you can have PHP generate an image file and put it in web forums which add there restrictions via the filename. If your really clever you can use Apache's url rewriting module to do things like turning http://www.example.com/banner/12/img.jpg into http://www.example.com/banner/img.php?id=12

but it can do it for any number without coding them seperately. Very use for allowing users to create banners and have then able to specify things like colour and size at whim.

 

 

There is of course a performance overhead from making Apache parse all HTML files as PHP, it needs to invoke the parse on each of them just for it to find they have no code in them, This can be avoided by putting all the HTML files that have PHP in them in a sub directory and moving the .htaccess file into that sub directory. Remember that a .htaccess file overides any .htaccess files closer to the root of the directory tree so repeat any other settings you had in .htaccess files.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...