Jump to content

Recommended Posts

Posted

Hi there,

 

domain: http://yoyo.heliohost.org

cPanel username: yoyo

 

When I access my website as http://yoyo.heliohost.org then my web-browser shows a "File Download" Dialog but works fine if I access http://yoyo.heliohost.org/index.html. Same is the case for URL http://yoyo.heliohost.org/letsyo, works fine as http://yoyo.heliohost.org/letsyo/index.html. I want that if a fine name is not provided in the end of a URL then the web-server should automatically send the index.html file.

 

Another thing

In my HTML files I have embedded certain code (links) via PHP.

We can request the web-browser to process .html files as PHP files by adding the following line to .htaccess

AddType application/x-httpd-php .html

 

so that PHP tags embedded in HTML files can also be processed by the web-server before serving the requested HTML.

 

While this approach works fine with my other host it does not work here.

Try accessing http://yoyo.heliohost.org/letsyo/index.html, there should have been a top and side links bar. There is none.

Works fine if I rename my HTMLs with PHP code to PHP.

 

Please suggest the needful.

 

Thanks

Sukhjinder...

Posted

Your .htaccess file was at fault. I've moved it to a file called ".ht" and your site seems to be working fine now.

Posted

Test Browser: K-Meleon 1.5

cPanel UserName: yoyo

Domain: yoyo.heliohost.org

 

Before renaming .htaccess to .ht (and adding some commands to it)

 

http://yoyo.heliohost.org/letsyo/index.html was working fine and http://yoyo.heliohost.org/letsyo/ was showing the "File Download" dialog. Now the behaviour is reversed.

 

Also I still don't know how to configure the web-server to process the PHP in my HTML files before serving them to the client web-browser. Hence all pages in the letsyo directory are showing up without the top and right links bar which are embedded via PHP code in my HTML pages.

 

I wish to move my website from my existing host to here.

 

The website should look like http://sukhjinder.cn and http://sukhjinder.cn/letsyo. My original host is migrating data to another server so the web-site shows the "Apache Test Page" sometimes. If you try visiting/refreshing the web-page a few times you might see how my site looks.

 

Thanks DJBob and everyone else.

Sukhjinder...

Posted

Yoyo, what are your access permissions on those files? The most common mode I use is 755. I don't fully understand how it works but it could be that. Can anyone else explain what all the modes mean?

Posted
Have the file end with .php and enclose your code in <?php and ?> tags.

 

Thanks DJBob. Due to certain reasons I dont want to rename my files from .HTML to .PHP. I've included the PHP code within correct tags in my HTMLs.

 

I found another option by creating An Apache Handler in cPanel here.

I clicked on the "Apache Handlers" icon then typed in "application/x-httpd-php" for .html but nothing changed.

 

Any other suggestions?

 

Thanks...

Posted

Since adding handlers utilized the .htaccess file and I renamed the file earlier, the changes were not taking effect. Try adding "AddType application/x-httpd-php .html" to .htaccess in your public_html directory.

Posted

my public_html dir already has .ht and .htaccess files. I tried adding the said statement to it but nothing changed. I guess .ht is disabling .htaccess.

 

Thanks

Sukhjinder...

Posted

Your .htaccess file is blank. Add the following to your .htaccess file.

AddType application/x-httpd-php .html

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...