Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Installation to sub directory getting directory listing


MonkMan

Recommended Posts

Posted

As per title, I just installed to www.mydomain.com/testsite. It seems like it is not reading the index.php file.

 

I read somewhere to use 301 redirect.

 

I go to cpanel, go to www redirect and add this:

 

Type: Permanent (301)

http://(www.)?mydomain.com/testsite

redirects to→ http://www.mydomain.com/testsite/index.php

 

 

for some reason, when i type in www.mydomain.com/testsite, i am still getting the directory listing. Any help would be much appreciated, not sure what I am doing wrong.

 

Thanks.

Posted

What happens, when you call www.mydomain.com/testsite/index.php

 

If it works, your webserver is not configured to show a index.php although just the directory was requested.

 

Tis option is set e.g. for the apache webserver in the httpd.conf

 

#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#

<IfModule dir_module>

DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \

default.php default.pl default.cgi default.asp default.shtml default.html default.htm \

home.php home.pl home.cgi home.asp home.shtml home.html home.htm

</IfModule>

For this example, the webserver is looking for all these pages, it someone request a directory.

 

But how this option is set, depends on the webserver you use, or the provier you use if have no full rights to configure the webserver.

Posted

You're very confused. OK, you installed osC into /testsite. Good, an application like osC should always be in its own subdirectory. That way, applications don't step on each other and you can put a "landing page" in the root, with links to the various applications. If you have only one application, you can have the URL rewritten so that the main site jumps directly to the osC application:

RewriteEngine On
RewriteCond  %{REQUEST_URI}  !^/testsite  [NC]
RewriteRule  ^(.*)$  /testsite/$1  [L]

That is the proper .htaccess rewrite, but rewrites work onlly on Apache servers. If your server is IIS, there would be some different way of doing it.

 

Remove Frank's code from your .htaccess. If when you go to a directory with no "index" file, you get a directory listing, you should add the following to your .htaccess:

Options -Indexes

That will prevent the directory listing from being generated, which is a security hazard.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...