Jump to content



Photo
- - - - -

If you get a directory listing instead of your main page...


This topic has been archived. This means that you cannot reply to this topic.
65 replies to this topic

#21   grooverider

grooverider
  • Members
  • 10 posts

Posted 22 April 2003 - 17:24

I was thinking that too and was going to suggest that Google would never find the duplicated default.php because nothing is linked to it, but it looks like "Catalog" in the bread crumb trail is linked to default.php.

Exactly why you should use the re-name or .htaccess method.

The require method will just ensure a page is brought up when you type in the address to your catalog without specifying a file. Clicking any links will then take you to default.php.

Catalog in the breadcrumb trail is linked to whatever you have defined FILENAME_DEFAULT to be in application_top.php. No links in the core code (or in any contributions come to that) should be hardcoded to point to default.php :shock:

#22   Xamu

Xamu
  • Members
  • 67 posts

Posted 22 April 2003 - 17:43

I was thinking that too and was going to suggest that Google would never find the duplicated default.php because nothing is linked to it, but it looks like "Catalog" in the bread crumb trail is linked to default.php.

Exactly why you should use the re-name or .htaccess method.

But it's not duplicated. It's the same file. Renaming it would require more work (as you stated above). Same for the .htaccess method. Part of the problem is that some folks can't create an .htaccess file. Probably more don't know how. This is a simple cure instead of a complicated one. /biggrin.gif' class='bbc_emoticon' alt=':D' />

The require method will just ensure a page is brought up when you type in the address to your catalog without specifying a file. Clicking any links will then take you to default.php.

Right. It doesn't matter what other links point at. This just gives you a nice, clean, short address for you to have for your store. One that works for those people whose hosts don't automatically serve default.php.
Xamu

#23 ONLINE   burt

burt

    Vanquisher of Demons

  • Community Team
  • 9,817 posts

Posted 22 April 2003 - 17:49

<snip loads of stuff>


What are you talking about ?

application_top.php:

change define('FILENAME_DEFAULT', 'default.php'); TO define('FILENAME_DEFAULT', 'index.php');

Rename the following file:
default.php TO index.php
/includes/languages/<language>/default.php TO /includes/languages/<language>/index.php



2 minutes work maximum, for even the greenest person. This does not create any extra work at all, all references in the code to default.php are now index.php as the code looks like this (for example):

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?>


#24   grooverider

grooverider
  • Members
  • 10 posts

Posted 22 April 2003 - 17:50

But it's not duplicated. It's the same file.


In the eyes of a search engine, index.php and default.php are two different files with exactly the same content.

Agree with you that it is a quick and simple fix though /biggrin.gif' class='bbc_emoticon' alt=':D' />

#25   grooverider

grooverider
  • Members
  • 10 posts

Posted 22 April 2003 - 17:55

That's what i was tring to say burt /laugh.gif' class='bbc_emoticon' alt=':lol:' />

#26   orchard

orchard
  • Members
  • 639 posts

Posted 22 April 2003 - 18:00

OK, I've been wondering, but now I just need to know:

1) Are there any servers anywhere that naturally go to default instead of index?

2) Is there somewhere in the world where the zip code goes before the state?

3) Is there somewhere in the world where they call the second line of the address the suburb?

4) Is the default store text hardcoded instead of in the admin just to make sure everyone has to hack at least once?

5) On the actual subject of this thread, is the horse dead or should we keep beating it?

P.S. - Not complaining, just wondering. I picked up PHP by working with osCommerce and learned it and like it well enough that I have converted my other web sites to use PHP. Require/include is way better than the HTML cut and paste method for keeping web sites maintainable.
In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

#27   Player0

Player0
  • Members
  • 64 posts

Posted 22 April 2003 - 18:01

Hehe...I wondered about a lot of that myself...especially the zip code thing /smile.gif' class='bbc_emoticon' alt=':)' />

#28   Ajeh

Ajeh
  • Members
  • 6,327 posts

Posted 22 April 2003 - 18:04

OK, I've been wondering, but now I just need to know:

1) Are there any servers anywhere that naturally go to default instead of index?

2) Is there somewhere in the world where the zip code goes before the state?

3) Is there somewhere in the world where they call the second line of the address the suburb?

4) Is the default store text hardcoded instead of in the admin just to make sure everyone has to hack at least once?

5) On the actual subject of this thread, is the horse dead or should we keep beating it?

P.S. - Not complaining, just wondering. I picked up PHP by working with osCommerce and learned it and like it well enough that I have converted my other web sites to use PHP. Require/include is way better than the HTML cut and paste method for keeping web sites maintainable.


1 Yes ... they have been properly configured for this. Depends on the hosting site.

2 no clue

3 Europe ... most of the osCommerce Team is from Europe ... /biggrin.gif' class='bbc_emoticon' alt=':D' />

4 All the text is in language files. Some where ... some how ... someone has to decide what it should read.

5 I like to keep beating it ... 8)

Latest Google email ... "Join the forums for help"

#29 ONLINE   burt

burt

    Vanquisher of Demons

  • Community Team
  • 9,817 posts

Posted 22 April 2003 - 18:09

That's what i was tring to say burt /laugh.gif' class='bbc_emoticon' alt=':lol:' />


Yeah I know, but it looked like you got ignored... /wink.gif' class='bbc_emoticon' alt=';)' />

Sounds like Xamu will stick to his guns about requiring default.php into index.php anyway - but it's a bad move.

BTW, all of the servers that I admin all have default.php as a directory index - most "Hosts" wouldn't have a clue how to change it.

#30   grooverider

grooverider
  • Members
  • 10 posts

Posted 22 April 2003 - 18:13

I think orchard's post was tongue in cheek... :wink:

p.s. I don't think the second line of an address is called "Suburb" in Europe - I've never seen it anywhere before anyway! If anything, i thought it was an Americanism. Guess it's a mystery then :?

#31   grooverider

grooverider
  • Members
  • 10 posts

Posted 22 April 2003 - 18:14

Yeah I know, but it looked like you got ignored... /wink.gif' class='bbc_emoticon' alt=';)' />


Thanks! Must be because i'm new /sad.gif' class='bbc_emoticon' alt=':(' /> /laugh.gif' class='bbc_emoticon' alt=':lol:' />

#32   Ajeh

Ajeh
  • Members
  • 6,327 posts

Posted 22 April 2003 - 18:17

p.s. I don't think the second line of an address is called "Suburb" in Europe - I've never seen it anywhere before anyway! If anything, i thought it was an Americanism. Guess it's a mystery then :?


I always figured that was a European thing. It sure isn't from here ... we call it something silly like Address 2 ... /biggrin.gif' class='bbc_emoticon' alt=':D' />

#33   orchard

orchard
  • Members
  • 639 posts

Posted 22 April 2003 - 18:17

BTW, all of the servers that I admin all have default.php as a directory index - most "Hosts" wouldn't have a clue how to change it.

Must be an English or European thing. I have several domains and have gone through several hosting companies recently and none of them naturally handled default.php as the index file.

The problem with editing the files to use index.php instead of default.php (besides beginners not knowing how) is that once your store is up and running, people put it in their favorites so you need to keep default.php working for them.
In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

#34 ONLINE   burt

burt

    Vanquisher of Demons

  • Community Team
  • 9,817 posts

Posted 22 April 2003 - 18:21

[quote][quote]BTW, all of the servers that I admin all have default.php as a directory index - most "Hosts" wouldn't have a clue how to change it.[/quote]Must be an English or European thing. I have several domains and have gone through several hosting companies recently and none of them naturally handled default.php as the index file.[/quote] /biggrin.gif' class='bbc_emoticon' alt=':D' /> /laugh.gif' class='bbc_emoticon' alt=':lol:' /> All the hosting companies you've used need a boot up the backside then. It is literally 30 seconds work to change it to accept default.php...

[quoteThe problem with editing the files to use index.php instead of default.php (besides beginners not knowing how) is that once your store is up and running, people put it in their favorites so you need to keep default.php working for them.[/quote]Well, thats not strictly true. The person who went in from their faves would just error out to 404.

You do have a 404 page right ? /wink.gif' class='bbc_emoticon' alt=';)' /> /smile.gif' class='bbc_emoticon' alt=':)' />

You could even make your 404 be default.php?action=404

And then pick up the $action, and give a nice error message...

Easy.

#35   Xamu

Xamu
  • Members
  • 67 posts

Posted 22 April 2003 - 18:29

Sounds like Xamu will stick to his guns about requiring default.php into index.php anyway - but it's a bad move.

Only until I hear a convincing argument. /laugh.gif' class='bbc_emoticon' alt=':lol:' />

So far I haven't been convinced. The alternatives that have been offered are all more work and/or require specific knowledge of osC conventions.

But I'm not unconvinceable. :wink:
Xamu

#36   orchard

orchard
  • Members
  • 639 posts

Posted 22 April 2003 - 18:29

Yes, I have a 404 page. It removes the .html from the end of requested document and tries it again with .php on the end, because I recently reorganized my web site using PHP.

I think we better bring in a new horse before PETA gets after us./smile.gif' class='bbc_emoticon' alt=':)' />
In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

#37   nrapt

nrapt
  • Members
  • 155 posts

Posted 25 April 2003 - 02:38

I am a little confused about trying to determine who has the 'better' method here. I tried the short index.php script seeking a default.php file, but it didn't work for me.
And of course I don't want to have any problems with search engines...
My files have a couple root files before getting to the catalog:
http://ezhandsfree/ecommerce/catalog

So, I tried this code in index.php:
<?php
require('ecommerce/catalog/default.php');
?>

And got this error code:
Warning: main(includes/application_top.php) [function.main]: failed to create stream: No such file or directory in /home/ezhandsf/wwwroot/ezhandsfree.com/ecommerce/catalog/default.php on line 13

Fatal error: main() [function.main]: Failed opening required 'includes/application_top.php' (include_path='') in /home/ezhandsf/wwwroot/ezhandsfree.com/ecommerce/catalog/default.php on line 13

Suggestions?
:? Jenn
Thank you for your time and energy.

#38   orchard

orchard
  • Members
  • 639 posts

Posted 25 April 2003 - 03:08

I think to have an index.php file that includes default.php and have it work they have to be in the same directory. One solution would be to move your store to the root directory, but then you would have to edit the configure.php files appropriately.

I just looked a http://www.php.net and there is a change directory function so this might work:
<?php 

chdir('ecommerce/catalog');

require('default.php'); 

?>
I haven't tried it, but it's worth a try. /smile.gif' class='bbc_emoticon' alt=':)' />
In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

#39   Xamu

Xamu
  • Members
  • 67 posts

Posted 25 April 2003 - 03:09

So, I tried this code in index.php:
<?php  
require('ecommerce/catalog/default.php');  
?>

You did it wrong. Leave out the ecommerce/catalog/ part

It's just
<?php
require('default.php');
?>

And it should be in the catalog directory. You were making it look for ecommerce/catalog/ecommerce/catalog/default.php if the index.php file was in ecommerce/catalog/

Of course, ecommerce/catalog/ecommerce/catalog/default.php doesn't exist.
Xamu

#40   orchard

orchard
  • Members
  • 639 posts

Posted 25 April 2003 - 03:21

Xamu,
I think the problem is that she wants http://ezhandsfree to go to the store who's default page is at http://ezhandsfree/e...log/default.php. By requiring default.php from the root directory, it is trying to find /includes/application_top.php when it should be looking for /ecommerce/catalog/includes/application_top.php. I just tried the chdir method and it works with this code.
<?php

chdir('catalog');

include 'default.php';

?>
You can try it at http://www.arbucklechurch.org/test.php. I didn't name it index.php because I didn't want to block access to our main web site.
In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink: