Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I rename index.php?


Guest

Recommended Posts

Posted

Actually, I don't want to rename it really. I just want to know where this statement is defined:

 

<a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>">

 

I have some of these links through out my web site that take me to http://www.myOSCdomain.com/index.php and I want them to go to the root of the web site instead (http://www.myOSCdomain.com/). Any ideas?

 

Thanks,

Chris

Posted
Actually, I don't want to rename it really. I just want to know where this statement is defined:

 

<a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>">

 

I have some of these links through out my web site that take me to http://www.myOSCdomain.com/index.php and I want them to go to the root of the web site instead (http://www.myOSCdomain.com/). Any ideas?

 

Thanks,

Chris

What exactly are you trying to accomplish?

 

http://www.myOSCdomain.com/index.php

http://www.myOSCdomain.com/

 

Unless you have a html file that you are wanting to call, your default is in the root of your website. If you have osC installed in the root then those two urls are basically the same thing.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted

I guess I was not clear enough in my question. Sorry.

 

This href is used through OSC:

<a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>">

 

It refers to the "default" page for the site which is index.php. When you click on this hyperlink it take you to index.php not the root of the domain (which I know is the same thing). The issue is that my root domain has a better search engine ranking than the index.php url. You know what I mean? Does this make more sense?

Posted
I guess I was not clear enough in my question. Sorry.

 

This href is used through OSC:

<a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>">

 

It refers to the "default" page for the site which is index.php. When you click on this hyperlink it take you to index.php not the root of the domain (which I know is the same thing). The issue is that my root domain has a better search engine ranking than the index.php url. You know what I mean? Does this make more sense?

No not really. If you have pages with a higher ranking that you want to use and you want to leave them there you should probably change your osC setup. If you have already replaced them with osC you will lose your ranking as the ranking are done by indivdual pages and if you change or remove them your rankings will change.

If you install osC into the root it is going to become your root. If you do not want it there then you should probably install it in /catalog or /store etc.

 

The file is defined in your filenames.php file look for

 

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

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted
The file is defined in your filenames.php file look for

 

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

 

I see, I guess there is no way I change that filename. I guess I will hard code the href's to just go to the root of the domain where ever I have this referenced. Bummer.

 

Thanks

Posted
The file is defined in your filenames.php file look for

 

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

 

I see, I guess there is no way I change that filename. I guess I will hard code the href's to just go to the root of the domain where ever I have this referenced. Bummer.

 

Thanks

To change it all you need to do is change the index.php to whatever you want it to be but your site will probably not work correctly if you do so. What file name are you wanting to use?

 

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

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted
To change it all you need to do is change the index.php to whatever you want it to be but your site will probably not work correctly if you do so. What file name are you wanting to use?

 

I don't want to use a file name. I just want it to go to the root of the domain. I don't think there is a way with the way this is written to be able to have all index.php links go to the root. I think mainly because index.php is used for other things too. Basiclly there are things like when you click on "Home" I want it to go to the root of the domain instead of index.php. There are several links like that throughout OSC and I was wanting it to do that but, it doesn't look like that is going to happen without me hard coding it.

Posted

For 'Home' in breadcrumbs search for (almost at the bottom)

$breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

in application_top.php. You can change tep_href_link(FILENAME_DEFAULT) to HTTP_SERVER for the root directory. I am not sure either about what you exactly mean by root because a file is always displayed, whether html or php, if not you just get a directory listing or nothing. I think you can also change which file is displayed by default in the .htccess file for Apache servers.

Posted
I am not sure either about what you exactly mean by root because a file is always displayed, whether html or php, if not you just get a directory listing or nothing.

 

Well, when you type in a web address (i.e. www.networkcablesonline.com) it does not display the index.php page in the address bar of the web browser. But, when I click on Home (or another hyperlink) on my site it goes to index.php and that is dispalyed in the address bar. My point is that www.networkcablesonline.com has a better ranking than www.networkcablesonline.com/index.php

 

Thanks again for the info, I will try that last suggestion and see what I get.

Posted

I understand what you mean networkcablesonline.com

My non-paged URLs also have a higher ranking than my URLs with index on them.

 

Destra, when you have a default list specified typing a directory does NOT show unless all the files in the default list do not exist.

 

You just need to change all the occurances of tep_href_link(FILENAME_DEFAULT) with the hyperlink for your root dir. (Whether you want it absolute or relative is your choice)

 

If you need more info let me know.

- - - -

Sometimes, ignorance is bliss.

Posted

Thanks drakonan,

 

I just did a replace on those links that were just going back to index.php (nothing else) like Home, Continue Shopping, etc with the full website name. It is a little better but, I am learning. Next time I will optimize the fule site with index.php included next time. Lesson learned.

 

Thanks everyone.

Archived

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

×
×
  • Create New...