syscon Posted July 15, 2003 Share Posted July 15, 2003 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 Link to comment Share on other sites More sharing options...
Rumble Posted July 15, 2003 Share Posted July 15, 2003 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! Link to comment Share on other sites More sharing options...
Dave_L Posted July 15, 2003 Share Posted July 15, 2003 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. Link to comment Share on other sites More sharing options...
syscon Posted July 15, 2003 Author Share Posted July 15, 2003 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 Link to comment Share on other sites More sharing options...
Dave_L Posted July 15, 2003 Share Posted July 15, 2003 What was the error? Link to comment Share on other sites More sharing options...
syscon Posted July 15, 2003 Author Share Posted July 15, 2003 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 Link to comment Share on other sites More sharing options...
syscon Posted July 15, 2003 Author Share Posted July 15, 2003 Click on this link and you will see, it is a link from google. http://www.sysconcept.ca/default.php?cPath=32_33 Joseph #Joseph Link to comment Share on other sites More sharing options...
Dave_L Posted July 15, 2003 Share Posted July 15, 2003 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. :) Link to comment Share on other sites More sharing options...
syscon Posted July 15, 2003 Author Share Posted July 15, 2003 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 Link to comment Share on other sites More sharing options...
thiswaynow Posted July 15, 2003 Share Posted July 15, 2003 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. Link to comment Share on other sites More sharing options...
syscon Posted July 15, 2003 Author Share Posted July 15, 2003 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.