Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

default.php not recognised - should I rename to index.php?


warrenthewindmill

Recommended Posts

I've tried setting up a .htaccess in the root directory and it is ignored.

 

My Host looks for:

 

default.html

default.htm

index.html

index.htm

index.shtml

index.php

index.php4

index.php3

index.phtml

 

in that order. I have searched their knowledge base and found a reference to .htaccess files. It says, "By default Apache does not look for .htaccess files, so if a user manually creates one in a directory it will be ignored"

 

Why shouldn't I just change the name of my default.php file to index.php. I guess that means I have to search for everywhere in the site default.php is referenced. I am using a big British outfit to host my site, "it's been named among the top ten fastest-growing technology companies in Europe" they say so I can't be the only one with this problem.

 

What does everyone else do?

Link to comment
Share on other sites

look in your httpd.conf file for the apache server and search for the following:

# AccessFileName: The name of the file to look for in each directory

# for additional configuration directives. See also the AllowOverride

# directive.

#

AccessFileName .htaccess

 

#

# The following lines prevent .htaccess and .htpasswd files from being

# viewed by Web clients.

#

<Files ~ "^.ht">

Order allow,deny

Deny from all

</Files>

 

For IIS servers, .htaccess does not work. You will have to do it differently.

Link to comment
Share on other sites

Rename catalog/default.php to index.php

 

Rename catalog/includes/languages/english/default.php to index.php

 

In catalog/includes/application_top.php, change:

 

 define('FILENAME_DEFAULT', 'default.php');

 

to:

 

define('FILENAME_DEFAULT', 'index.php');

Link to comment
Share on other sites

add the following to your httpd.conf file for the catalog directory.

DirectoryIndex default.php

you can make it index.php for the admin directory.

Link to comment
Share on other sites

admin already has an index.php .... there is no problem with you making the change in the catalog.... it is often easier than getting a host to change the Apache httpd.conf

Link to comment
Share on other sites

or just create a new php file and reroute it to index.html,

 

<?php

header("location:http://www.yourdomain.com/pathtocatalog/default.php");

?>

For an osCommerce and STS Tutorial click the www button in my profile.

Link to comment
Share on other sites

or just create a new php file and reroute it to index.html,

 

<?php  

header("location:http://www.yourdomain.com/pathtocatalog/default.php");  

?>

 

This is not a good option as far as search engines go...

Link to comment
Share on other sites

If you create an .htaccess file in your root directory, you can tell it the files to look for.

 

Be sure to check if you already have one. NOTE: Some FTP programs will not show this file so if you have Cpanel or something similar to view your site, check with that first.

 

Create the .htaccess file in a text editor:

DiRectoryindex index.shtml index.html index.htm index.php default.php /missing.html

AddHandler server-parsed .shtml

AddHandler server-parsed .html

AddHandler server-parsed .htm

 

This one also has missing.html for when people go where they should not. Just create that as a regular HTML file with some links to get them back to an appropriate location.

Link to comment
Share on other sites

If you create an .htaccess file in your root directory, you can tell it the files to look for.

 

Note, this will only work if the Server Admin has configured the server to accept user .htaccess

 

Why not simply rename the 2 files and make the change in application_top. It's 5 minutes work for even the greenest person.

Link to comment
Share on other sites

If you create an .htaccess file in your root directory, you can tell it the files to look for.

 

Note, this will only work if the Server Admin has configured the server to accept user .htaccess

 

Why not simply rename the 2 files and make the change in application_top. It's 5 minutes work for even the greenest person.

 

Simplicity is a wonderful thing... :wink:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...