View Full Version : Root install /index.php fix

01-25-2007, 07:11 AM
If you have a store that is installed in the root directory (you DO NOT have a /catalog dir -- you go directly to www.domain.com and your store is right there) this contribution may be for you.

What it does:

When you are on a page your site, to search engines especially, would show as www.domain.com AND www.domain.com/index.php we all know that you don't need the index.php one and you do not want to show two links with the same content to the search engines...

So. here is what I did.

First in:



require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);


require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT_HOME);

Then, in: includes/filenames.php find:

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

And change it to:

// Start index.php fix.
// define('FILENAME_DEFAULT', 'index.php');
define('FILENAME_DEFAULT', '');
define('FILENAME_DEFAULT_HOME', 'index.php');
// End of index.php fix.

Now all the links in header and footer, etc. that use to say www.domain.com/index.php will only say www.domain.com.

There are A LOT of other fixes for this on osCommerce forums and they either involved changing a bunch of files and other ways that I couldn't get to work (I'm sure they must work, but I couldn't get them to work (along with a few other people).

I have tested this as much as I could -- if you can make it better, please do so!


More... (http://www.oscommerce.com/community/contributions,4835)