Link to home
Start Free TrialLog in
Avatar of tballah
tballah

asked on

index.php is not displayed when using http://www.mysite.com/, but display if using http://mysite.com

I bought a hosting service from a provider who deploys Apache as a web server running on Linux OS. My home directory is /home/angkorci/public_html under which contains also .htaccess file with permission 0644. My problem is to access to my site using http://www.mysite.com, the default page index.php is not displayed but the browser lists all the sub directories of /home/angkorci/public_html while using http://mysite.com (without adding www as prefix) the default page can be displayed normally. The page can be also displayed by using http://www.mysite.com/index.php i.e. I have to specify the page index.php.

I would like to know how I can resolve or fix this issue? What I want is the default page index.php can be displayed using either http://mysite.com or http://www.mysite.com
SOLUTION
Avatar of caterham_www
caterham_www
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tballah
tballah

ASKER

In the code snippet it is the content of .htaccess that I just added, but I still face the same problem as I mentioned to you and I still see the sub directories when using http://www.mysite.com

Was there any mistake I made in the content of .htaccess?




DirectoryIndex index.php
Options -Indexes

Open in new window

No, but you may change it to
asdfasf

That should return an internal server error. If not, you're not allowed to use .htaccess files per server-config setting. You may clear the browser cache as well since the dir listing might be cached.
Avatar of tballah

ASKER

When accessing to http://www.mysite.com from my office where the proxy ISA server is used, then I can see that the default page can be displayed. I use the same browser from the same laptop as I access to this site from home. How could I delete the cache files from the browser, I use both IE and FireFox
Firefox: Tools --> Options -> Privacy
IE: Tools --> Internet Options and thn within the 'General' tab.

You may also force to reload a page via [ctrl] + [F5]
Avatar of tballah

ASKER

Now I'm currently in office and could not try your suggestion yet, when I'm back home and I will try to access the mentioned website, clear the cache and let you know the result.
Avatar of tballah

ASKER

I'm home now and I followed as what you suggested me to do but with no good result. When I try to enter URL address like http://www.mysite.com, I get the following directory listing as follows:

Index of /
    .ftpquota
    ActAd_assets/
    cgi-bin/
    css/
    img/
    js/

Why I could not find index.php within this list? I don't control the Apache global configuration as it is done by hosting service provider and I can deal with .htaccess file under public_htm folder as I mentioned earlier. What should I do next? I want to get both http://mysite.com and http://www.mysite.com worked but I have no luck with prefix www of mysite.com domain

Would you have other suggestions?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tballah

ASKER

I'm sorry for being late to respond as there was an Internet outage at home yesterday and now I'm currently in office and could not access web portal control panel to my hosting service provider. I will check it when I'm home (if the Internet service is recovered) and let you know. Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so you still see the list of files when you go to the page ?
is index file still missing ?

if so you are working in the wrong place (as above)