Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

default.php to index.php 2.2ms2


syscon

Recommended Posts

Posted

With the new version of 2.2ms2 the default.php was replaced with index.php.

Now all the links from a search engine are pointing to "default.php" are invalid as it changed to "index.php" in URL

 

How to redirect them to the right place?

 

Joseph

#Joseph

Posted

make a copy of index.php and name it default.php so you have both files in the catalog folder!?

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Posted

Or create a default.php with the following contents:

 

<?php

header('Location: http://example.com/catalog/index.php');

exit;

?>

 

Replace example.com with the correct path.

Posted

Creating default.php with this code:

<?php

header('Location: http://example.com/catalog/index.php');

exit;

?>

 

Gave me an error (yes, I replaced the example.com with my domain).

 

but Randy's solution worked like a charm; making second copy of index.php with name default.php.

 

Thanks folks.

Joseph

#Joseph

Posted

Dave, it gave me the following error:

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/sysconcept_ca/catalog/default.php:1) in /var/www/html/sysconcept_ca/catalog/default.php on line 2

 

I've tried two combinations:

header('Location: http://www.sysconcept.ca/index.php');

and

header('Location: http://www.sysconcept.ca/catalog/index.php');

 

The same error message comes up.

 

Regards,

Joseph

#Joseph

Posted

In your case, header('Location: http://www.sysconcept.ca/index.php'); should be correct.

 

That error could occur if there are extraneous characters (spaces, line breaks, etc.) outside of the <?php ?> brackets.

 

I was just curious about the error. I use redirection scripts such as this without any problems.

 

Since the other method works for you, you may not want to spend time diagnosing this. :)

Posted

Dave, you are right.

I've copied your script but for some reason or another where was an extra space in the beginning and at the end. Removing that space fixed the problem.

 

I like your solution too. :D

 

Regards,

Joseph

#Joseph

Posted

Google doesn't like redirects... creating the forwarding script wil cause a dip in your google ranking while google notices that the default.php page is no longer in use, and before it fully picks up index.php.

 

I would keep both files in place until index.php has been fully indexed by google, then go for the redirect option.

Posted

Thanks for the hint, so I will just make a copy of index.php with name default.php I guess.

 

I remember the times when Yahoo :D was a "King" search engine and they had better indexing method. My web-page pages were almost at the top for any particular keywords. Their indexing method was fair; Google is just paying games with our web-pages (one day your are there the next day you are not).

In addition I could find any anything I want it, even by part number.

 

Now when Google :twisted: is in power everything is screwed. I wish somebody (except Microsoft) had replaced them.

 

Joseph

#Joseph

Archived

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

×
×
  • Create New...