Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't use default.php must use index.php


rondee1246

Recommended Posts

Hello, my unix host will not open webpages if they are named default.php or for that matter default.htm. I have to rename to index.php to get them to work. (i.e. /catalog/default.php must be /catalog/index.php)

My problem is that all the links in the categories box point to default.php, where do I change this?

:?

Link to comment
Share on other sites

I go about this by creating and index file to redirect to default.php

 

Example:

 

<html>

<HEAD>

<TITLE>Redirector</TITLE>

<META NAME="Author" CONTENT="">

<META NAME="Description" CONTENT=" ">

<META HTTP-EQUIV="refresh" CONTENT="1 ;URL=http://www.yousire.com/catalog/default.php">

</HEAD>

Link to comment
Share on other sites

try this:

 

i create a file called index.php and slap this code in it

 

<?

if ($QUERY_STRING == '') 

{ 

header ("Location:http://www.leaderfloors.co.uk/catalog/default.php"); 

exit; 

} 

?>

 

:) hope this helps :)

Link to comment
Share on other sites

I advise that you avoid any type of redirect. Christian or miyake idea is the best. Some or most of the search engines do not like redirect and they will not index your site. There is several post on this in these forums. Check it out.

Steve

-------------------------

Link to comment
Share on other sites

I have a .htaccess file in my root. Note if using FrontPage this may be a bad idea check with your hosting site to do this for you.

 

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

 

Now when you type http://www.yourdomain.com/yourdirectory it will by default hunt down what page to open in the order you have them listed above.

 

Note: I have a missing.html that handles anything anyone tries to do that is bad or sneak into a directory without an index.

Link to comment
Share on other sites

I created an index.php with only the line

<?php include('default.php'); ?>

in it. Works like a charm but does anyone know of any disadvantages to this approach? I'm considering taking Linda's advice and just adding default.php to my .htaccess file. Problem is, I have Frontpage extensions installed. I've edited my .htaccess before with no problems, and besides, I don't upload any FrontPage pages to my /catalog directory anyway.

I haven't lost my mind,

I have it backed up on disk, somewhere...

Link to comment
Share on other sites

OK, I agree redirection is bad.

Thanks for the advice.

 

Now just out of curiosity, how do you guys out there redirect pages from the root?

 

Eg.

 

http://www.mysite.com --> http://www.mysite.com/catalog/

 

 

My initial idea was to have a splash page with the user clicking on 'ENTER'.

This of course applies to those who wants to have the osCommerce page as their main page.

Link to comment
Share on other sites

I just did this same thing yesterday. My host uses index.php and not default.php. I did it the way Christian Lescuyer suggested.

 

I renamed my defalut.php pages to index.php and then in application_top.php, changed:

 

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

 

to

 

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

 

Works like a charm.

 

:D

Link to comment
Share on other sites

I renamed my defalut.php pages to index.php and then in application_top.php, changed:

 

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

 

to

 

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

 

Works like a charm.

 

:D

 

That's the ticket! :P

I haven't lost my mind,

I have it backed up on disk, somewhere...

Link to comment
Share on other sites

I used Linda's method and it works perfect. I had troubles with the the application_top.php editing method and my server. @#$% safe mode problems. And MS Front Page 98 works too.

 

Thanks Linda.

 

Steve

Steve

-------------------------

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...