Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to rename index.php


Guest

Recommended Posts

I would like to rename index.php to something like store.php. How should I do that?

 

I changed FILENAME_DEFAULT in filenames.php from index.php to store.php.

 

Then I renamed catalog/index.php to catalog/store.php and catalog/includes/languages/english/index.php to catalog/includes/languages/english/store.php.

 

That didn't seem to do it though, so I must be missing something else that needs to be changed???

Link to comment
Share on other sites

Thats how you do it - make sure you did it in /includes/filenames.php and not /admin/includes/filenames.php - it is better to rename the old file before uploading your modified file - sometimes it appears to overwrite but doesn't :)

 

Matti

Link to comment
Share on other sites

I would like to rename index.php to something like store.php. How should I do that?

 

I changed FILENAME_DEFAULT in filenames.php from index.php to store.php.

 

Then I renamed catalog/index.php to catalog/store.php and catalog/includes/languages/english/index.php to catalog/includes/languages/english/store.php.

 

That didn't seem to do it though, so I must be missing something else that needs to be changed???

 

I'm not sure why you would want to do that, but I'll assume you have a good reason. Most web servers are configured so that the index.php or index.html file are loaded when someone browses to the root of a particular folder, assuming a file of that name exists in the folder. osC was designed with that in mind as are most applications. So just off the top of my head you would need to make changes to your configure.php files in addition to the changes you mentioned. There might be others as well.

 

If the solution you are ultimately looking for is to have visitors to your site land on a page other than you shopping cart first, an easier approach might be to place osC in /catalog/ or some other sub folder.

 

Be well,

Tina

If you're not having fun you're not doing it right

 

Teach a person to fish rather than give them a loaf of bread or however that saying goes.

Link to comment
Share on other sites

I'm not sure why you would want to do that, but I'll assume you have a good reason. Most web servers are configured so that the index.php or index.html file are loaded when someone browses to the root of a particular folder, assuming a file of that name exists in the folder. osC was designed with that in mind as are most applications. So just off the top of my head you would need to make changes to your configure.php files in addition to the changes you mentioned. There might be others as well.

 

If the solution you are ultimately looking for is to have visitors to your site land on a page other than you shopping cart first, an easier approach might be to place osC in /catalog/ or some other sub folder.

 

Be well,

Tina

 

Tina,

 

For my site now, the root is the index.php page of osC. I need to change that and have an "entry" page before entering the store. I hate to move everything to /catalog/ now because the site is indexed well in the search engines. So, I thought I could rename osC's index page to store.php and use index.php as my entry page. Does that make sense?

 

What change would I need to make in configure.php to accomplish that?

 

Thanks a bunch!!

Link to comment
Share on other sites

Thats how you do it - make sure you did it in /includes/filenames.php and not /admin/includes/filenames.php - it is better to rename the old file before uploading your modified file - sometimes it appears to overwrite but doesn't :)

 

Matti

 

Matti,

 

I've tried doing this a few times and followed your advice about renaming the files first, but it still doesn't seem to be working? Is there something I would need to change in configure.php as Tina suggested?

 

Thanks!

Link to comment
Share on other sites

Before changing the name of index.php I would try creating index.html and see if that gets picked up first. Servers are set up to look for names in a particular order, ask your host which names are looked for first.

Link to comment
Share on other sites

Before changing the name of index.php I would try creating index.html and see if that gets picked up first.

 

Thanks, that does seem to work. I'm reluctant to do that, though, since the index.html page hasn't been indexed by the search engines.

 

Hmmm...am I missing something about renaming index.php to store.php??

Link to comment
Share on other sites

Thanks, that does seem to work. I'm reluctant to do that, though, since the index.html page hasn't been indexed by the search engines.

 

Hmmm...am I missing something about renaming index.php to store.php??

 

No in a stock install, changing /includes/filenames.php would do it. But if you have contributions installed or other modifications, it is possible that there are direct references to index.php instead of the filename call.

 

If it is directing to the wrong page right from the page load, you might search application_top.php or possibly header.php for direct calls to "index.php". There should be one reference to it in application_top where it tests for a new install, that one is ok though.

 

If it goes to the wrong page after a particular link is clicked, check the file with the link for a direct link to index.php.

 

If you end up just using the index.html solution, keep in mind that until that page gets indexed, the search engines would still be bringing them to your site, just not to your entry page. In time, they would index the new page and all would be well.

 

hth

Rule #1: Without exception, backup your database and files before making any changes to your files or database.

Rule #2: Make sure there are no exceptions to Rule #1.

Link to comment
Share on other sites

No in a stock install, changing /includes/filenames.php would do it. But if you have contributions installed or other modifications, it is possible that there are direct references to index.php instead of the filename call.

 

I've searched through my files, and the only direct reference I see to index.php is in application_top where it tests for a new install

If it is directing to the wrong page right from the page load, you might search application_top.php or possibly header.php for direct calls to "index.php".

 

Actually, what happens is my directory struction is displayed in the browser after changing the filename_default to store.php and renaming all of my index.php files to store.php. That's what made me think I was perhaps misisng something else that needed to be changed. :huh:

 

If you end up just using the index.html solution, keep in mind that until that page gets indexed, the search engines would still be bringing them to your site, just not to your entry page. In time, they would index the new page and all would be well.

 

Good point...that does put me a little at ease if we have to go that route. Thanks!

Link to comment
Share on other sites

Actually, what happens is my directory struction is displayed in the browser after changing the filename_default to store.php and renaming all of my index.php files to store.php. That's what made me think I was perhaps misisng something else that needed to be changed. :huh:

 

When you rename the index.php file, what URL are you entering to test it? The results you describe make me think that you are just entering the domain name and you don't have any index files in the folder so it displaying the file list. To test the filename change you would enter the domain name followed by /store.php.

 

Also, regarding "all of my index.php files". You would definitely need to change /index.php but not /admin/index.php. I am not sure whether you should change /includes/languages/english/index.php. If you change that one and get a lot of field names or the page won't load, then change it back.

Rule #1: Without exception, backup your database and files before making any changes to your files or database.

Rule #2: Make sure there are no exceptions to Rule #1.

Link to comment
Share on other sites

When you rename the index.php file, what URL are you entering to test it? The results you describe make me think that you are just entering the domain name and you don't have any index files in the folder so it displaying the file list.

 

My bad...you are right...during that last test, I hadn't moved over the new index.php file

 

However, when I moved over the new index.php file, I experienced the same problem as before...when I click to view a category of products, I just see a refresh of the new index.php file. However, if I type in a direct link to a product_info page, that displays just fine, so it looks like it's just the product listings in the category view that aren't working.

 

Any ideas??

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...