yoyo Posted September 29, 2008 Posted September 29, 2008 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...
Wizard Posted September 29, 2008 Posted September 29, 2008 Strange, if I go to http://yoyo.heliohost.org/index.html, it'll end up as a file download as well.
Ashoat Posted September 30, 2008 Posted September 30, 2008 Your .htaccess file was at fault. I've moved it to a file called ".ht" and your site seems to be working fine now.
yoyo Posted September 30, 2008 Author Posted September 30, 2008 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...
mindstorm8191 Posted September 30, 2008 Posted September 30, 2008 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?
Ashoat Posted September 30, 2008 Posted September 30, 2008 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.Both are working fine for me.
yoyo Posted October 1, 2008 Author Posted October 1, 2008 Yes both (http://yoyo.heliohost.org/letsyo/index.html and http://yoyo.heliohost.org/letsyo/ )working fine for IE 6, FireFox 3 not K-Meleon 1.5 Now still looking for help on processing PHP code within HTML files. How can I request the Web-Server to process the PHP code before submitting it to the client Web-Browser? Thanks Sukhjinder...
Ashoat Posted October 1, 2008 Posted October 1, 2008 Have the file end with .php and enclose your code in <?php and ?> tags.
yoyo Posted October 2, 2008 Author Posted October 2, 2008 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...
Ashoat Posted October 3, 2008 Posted October 3, 2008 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.
yoyo Posted October 4, 2008 Author Posted October 4, 2008 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...
Ashoat Posted October 4, 2008 Posted October 4, 2008 Your .htaccess file is blank. Add the following to your .htaccess file. AddType application/x-httpd-php .html
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now