Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-12
11
Medium Priority
?
593 Views
Last Modified: 2010-03-04
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
0
Comment
Question by:tballah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 27

Assisted Solution

by:caterham_www
caterham_www earned 600 total points
ID: 22698910
Open your .htaccess file and add

DirectoryIndex index.php

You may disable the dir listing (if there's no index.php) as well with

Options -Indexes
0
 
LVL 1

Author Comment

by:tballah
ID: 22698994
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

0
 
LVL 27

Expert Comment

by:caterham_www
ID: 22699387
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.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 1

Author Comment

by:tballah
ID: 22700860
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
0
 
LVL 27

Expert Comment

by:caterham_www
ID: 22701038
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]
0
 
LVL 1

Author Comment

by:tballah
ID: 22701400
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.
0
 
LVL 1

Author Comment

by:tballah
ID: 22702637
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?
0
 
LVL 20

Assisted Solution

by:edster9999
edster9999 earned 400 total points
ID: 22706402
it looks like the file is not in the right directory.  Look at your conf file that defines the sites you host (or look at your control panel).  One of those should show you where the directory is.  You need to put the file in there.

Make sure it is readable by the user apache runs at.  if you are not sure set it to world readable

chmod 644 index.php
0
 
LVL 1

Author Comment

by:tballah
ID: 22719140
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
0
 
LVL 1

Accepted Solution

by:
tballah earned 0 total points
ID: 22731345
Before I changed index.php to 644, it was set 755. After the change it still does not work. I would ask for technical support from this service provider, maybe I could not do anything with home profile configuration.
0
 
LVL 20

Expert Comment

by:edster9999
ID: 22731560
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)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question