OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Remove index.php when browsing back to main page
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
Pages: 1, 2
Java Roasters
One of the suggestion I received for my site was to remove the index.php from "continue" buttons and the breadcrumb trail so when you return to the main page it is www.yoursite/ instead of www.yoursite/index.php. This was suggested for SEO reasons.

To do this go to catalog/includes/filesnames.php and add;

CODE
 define('FILENAME_HOME', '/');


CONTINUE BUTTON

To change the buttons search your site for;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


And replace with;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_HOME) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


The only change being DEFAULT changed to HOME. There are not many instances of this so it is easy to do, I found none in the admin side so a site search and replace should be okay. whistling.gif

BREADCRUMB TRAIL

To change the breadcrumb trail open catalog/includes/application.top and find;

CODE
 //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));


And replace with;

CODE
 //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_HOME));


That's all. This will take the file index.php out of your file names and so all pages will link back to your main domain (www.yoursite.com/) and avoid any chance of SE's seeing it as duplicate page content.

Thanks to misterbling for the tip, much appreciated.

Peter
Mighty Mike
Thanks Peter

Great Tip
misa
QUOTE
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


In which file can I find above line?
Java Roasters
QUOTE
In which file can I find above line?


If you have a good PHP editor you should be able to search for it. My site is very modified so I can't tell you for sure what pages it is on.

Try;
shopping_cart.php
logoff.php
gv_redeem.php
cookie_usage.php

and maybe the info box pages
billybrag
Thanks for the great tip


I have a quick q though

i have implemented this so that when i click on the stores logo it does the same and it does work however it gives

www. mydomain.co.uk//

i have tried changing the code
CODE
define('FILENAME_HOME', '/');

to
CODE
define('FILENAME_HOME', '');


but that throws up an error?!

any ideas?

thanks again
moonbeam
Thanks for the advise,
Now my site reads http//:mysite.com//
Is that right? 2(//) on the end?


Thanks again,
Moon
Java Roasters
QUOTE
www. mydomain.co.uk//


QUOTE
Now my site reads http//:mysite.com//
Is that right? 2(//) on the end?



It is probably caused by a variation between our configure.php files.
moonbeam
QUOTE (Java Roasters @ Jun 29 2005, 12:28 AM)
It is probably caused by a variation between our configure.php files.
*



So.... , it shouldn't be this way?
With the two ( // ).
Thanks,
Moon
billybrag
QUOTE (moonbeam @ Jun 29 2005, 12:35 PM)
So.... , it shouldn't be this way?
With the two ( // ).
Thanks,
Moon
*


i cant get this to stop it,

i have compared the two config files and there is nothing obvious,

any suggestions?
moonbeam
Yeh, me to...
I compared the two myself, don't see a difference.
Oddly enough I installed Ultimate SEO url's and now all works fine.
The double / / is gone...Go figure!
Moon
billybrag
thanks to help from java roasters and yesudo, this now works with


in includes/functions/html_output.php change:

CODE
if ($connection == 'NONSSL') {
     $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
   } elseif ($connection == 'SSL') {
     if (ENABLE_SSL == true) {
       $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
     } else {
       $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
     }
   } else {
     die('</td></tr></table></td></tr></table><br><br><font
color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
   }

To:

CODE
if($page = '/')
   {
     if ($connection == 'NONSSL') {
       $link = HTTP_SERVER;
     } elseif ($connection == 'SSL') {
       if (ENABLE_SSL == true) {
         $link = HTTPS_SERVER;
       } else {
         $link = HTTP_SERVER;
       }
     } else {
       die('</td></tr></table></td></tr></table><br><br><font
color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
     }
   }
   else
   {
     if ($connection == 'NONSSL') {
       $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
     } elseif ($connection == 'SSL') {
       if (ENABLE_SSL == true) {
         $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
       } else {
         $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
       }
     } else {
       die('</td></tr></table></td></tr></table><br><br><font
color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
     }
   }


This will allow tep_href_link to work with FILENAME_HOME without duplicating
misterbling
Just an FYI;

Anyone usine a "browse by categories" type of contribution in the sub you might have a link back to index.php

Also The manufacturers box has reference to index.php

Also the header image by default might be a link to index.php

IMPORTANT to remove all index.php if we're going this route. I really bungled my site but will be ok the next PR update due to this. ie;

http://www.misterbling.com PR2
/index.php PR2

Should have been
http://www.misterbling.com PR4
/index.php PR0

How can I be sure you say? Every link from my homepage of PR2 is a PR 3 LOL. My sitemap is a PR 3, My products are even higher or the same PR as the homepage. Seem I shot myself in the foot because I didn't seek out all the index.php references.

Any other index.php's found please let me know.

tool to find out;

http://www.gritechnologies.com/

tool with PR results; (use google option)

http://mesoimpact.com/spider/
Sean416
Thanks! This was on my list of things to figure out. smile.gif
Reesy
QUOTE (Java Roasters @ Jun 12 2005, 05:03 AM)
One of the suggestion I received for my site was to remove the index.php from "continue" buttons and the breadcrumb trail so when you return to the main page it is www.yoursite/ instead of www.yoursite/index.php.  This was suggested for SEO reasons.

To do this go to catalog/includes/filesnames.php and add;

CODE
 define('FILENAME_HOME', '/');


CONTINUE BUTTON

To change the buttons search your site for;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


And replace with;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_HOME) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


The only change being DEFAULT changed to HOME.  There are not many instances of this so it is easy to do, I found none in the admin side so a site search and replace should be okay.   whistling.gif

BREADCRUMB TRAIL

To change the breadcrumb trail open catalog/includes/application.top and find;

CODE
 //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));


And replace with;

CODE
 //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_HOME));


That's all.  This will take the file index.php out of your file names and so all pages will link back to your main domain (www.yoursite.com/) and avoid any chance of SE's seeing it as duplicate page content.

Thanks to misterbling for the tip, much appreciated.

Peter
*


Is there any reason why you cant just change FILENAME_DEFAULT to
define('FILENAME_DEFAULT', '/');

Just wondering as it seems a little easier...
rommany
Hello

Great tip and it works great for me so far, but i have a small problem

when i change the cont button it goes from

/index.php?osCAdminID=9913d3649e6dc910e9ee2d37269a6af4

to

/?osCAdminID=9913d3649e6dc910e9ee2d37269a6af4

is it possible to remove the ?oscAdmin part or im i stuck with this ?


Kind regards
rommany
Sorry me again


I sorted the above part out just by removing the numbers and osc bit, looks like it works ok,

but one more little thing.

in the catagories box when clicked opens a page Eg baby shoes

co.uk/index.php?cName=baby-shoes came up

when i changed the DEFAULT to HOME the index.php went but so did the baby shoes bit and i was left with numbers EG 21-28

I have installed Chemos Ultimate so not sure what else i would need to change for this to remove the index.php part but keep my baby shoes bit.


Kind regards
stubbsy
Thanks for the tips, work great. The only thing missing was to change the link when you click on the logo for the site which you can do in includes/header.php

find around line 57

CODE
<a href="' . tep_href_link(FILENAME_DEFAULT) . '">


and replace with

CODE
<a href="' . tep_href_link(FILENAME_HOME) . '">


cheers

stubbsy
AnnasAttic
I am getting the double /.
However when I change code in html_output.php I get parse error?
Just wondering if anybody else having same problem?

Other than that this works great, was wanting this on my website.
Thanks to all for this.
toystoreking
How about just doing a permanent redirect?
peterrankin
How do you do a site search and replace?

QUOTE (Java Roasters @ Jun 12 2005, 12:03 AM) *
One of the suggestion I received for my site was to remove the index.php from "continue" buttons and the breadcrumb trail so when you return to the main page it is www.yoursite/ instead of www.yoursite/index.php. This was suggested for SEO reasons.

To do this go to catalog/includes/filesnames.php and add;

CODE
  define('FILENAME_HOME', '/');


CONTINUE BUTTON

To change the buttons search your site for;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


And replace with;

CODE
<?php echo '<a href="' . tep_href_link(FILENAME_HOME) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?>


The only change being DEFAULT changed to HOME. There are not many instances of this so it is easy to do, I found none in the admin side so a site search and replace should be okay. whistling.gif

BREADCRUMB TRAIL

To change the breadcrumb trail open c


atalog/includes/application.top and find;

CODE
  //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));


And replace with;

CODE
  //$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_HOME));


That's all. This will take the file index.php out of your file names and so all pages will link back to your main domain (www.yoursite.com/) and avoid any chance of SE's seeing it as duplicate page content.

Thanks to misterbling for the tip, much appreciated.

Peter
yesudo
QUOTE (peterrankin @ Nov 17 2005, 10:56 PM) *
How do you do a site search and replace?


Use a text search tool like wingrep.
eww
doesn't seem to work for me.
if i use billybrag's edit (along with java roaster's... which made http://www.mysite.com// ) it just shows all the subcategories with the cPath in the url
lrparr
I'm having trouble removing all index.php's. Can someone tell me what the risk is of having them reference? Thanks, I know it's probably a stupid ?
Java Roasters
I'm having trouble removing all index.php's. Can someone tell me what the risk is of having them reference? Thanks, I know it's probably a stupid ?

It is for the search engines as they see www.yourdomain.com/ and www.yourdomain.com/index.php as two seperate pages both with identical content. This will cause them to split your Page Rank between the two pages or maybe even penalize you a bit for having identical pages. So if you remove all links to index.php then you are left with just one page and that should give you better Search Engine placement.

HTH
eww
i take it this edit doesn't work well with certain url rewrite contributions? smile.gif i use nimmit's and i experienced the problem 2 posts up, but it seems to work fine on your site java roasters
sweetafton
the main page of my website is http://mysite.com/catalog. i can go to http://www.mysite.com/catalog. but when i click any other page eg prudct page the www will gone. and there is another problem. that is when i browse http://www.mysite.com it appears 404 error. looks like http://mysite.com/catalog because my home page.

there are two things i don't know what to do .

first i want make http://www.mysite.com for my homepage not http://mysite.com/catalog.
second i want my site just looks like most others have the www in font when browsing. now like http://mysite.com........at the moment. can anyone tell me what should i do please.
i am using web host . with unix system.php 4.
Java Roasters
QUOTE (sweetafton @ Jan 3 2006, 05:12 AM) *
the main page of my website is http://mysite.com/catalog. i can go to http://www.mysite.com/catalog. but when i click any other page eg prudct page the www will gone. and there is another problem. that is when i browse http://www.mysite.com it appears 404 error. looks like http://mysite.com/catalog because my home page.

there are two things i don't know what to do .

first i want make http://www.mysite.com for my homepage not http://mysite.com/catalog.
second i want my site just looks like most others have the www in font when browsing. now like http://mysite.com........at the moment. can anyone tell me what should i do please.
i am using web host . with unix system.php 4.


These are all things for your configure.php files and don't have much to do with this thread. You have to just move all the files to your root directory. If you have an FTP program it is quite easy just make a backup first and check the backup to make sure it is valid.

After that just remove the "catalog" refrences in your 2 configure.php files. As for the www part in your URL's that is also part of you configure.php files. You have a section that says;

define('HTTP_SERVER', 'http://www.mydomain.com'); //
define('HTTPS_SERVER', 'https://www.mydomain.com'); //

The 404 error will go away when you move your site to the root directory.

make sure you have added the www there. There are MANY threads on moving your shop to the root directory and also on configure.php files if you get stuck or need more info 'search" will find the answers for you.

Peter
Kenja
I thought of a much cleaner way of implementing this functionality. You won't have to worry about searching your site and changing all the FILENAME_DEFAULT instances to FILENAME_HOME. In fact, you don't have to define FILENAME_HOME. Also you don't have to be anal about checking all new contribs for FILENAME_DEFAULT.

Go to catalog/includes/functions/html_output.php and change
CODE
if ($connection == 'NONSSL') {
      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL == true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
      } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
      }
    } else {
      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
    }


to:
CODE
    if($page == FILENAME_DEFAULT && $parameters=='')  //traps all references to index.php made without any passed parameters like cPath, etc...
       {
        $page == '/';  //Changes the path from 'index.php' to '/'
         if ($connection == 'NONSSL') {
           $link = HTTP_SERVER;
         } elseif ($connection == 'SSL') {
           if (ENABLE_SSL == true) {
             $link = HTTPS_SERVER;
           } else {
             $link = HTTP_SERVER;
           }
         } else {
               die('</td></tr></table></td></tr></table><br><br><font
            color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
            connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
         }
       }
       else
       {
         if ($connection == 'NONSSL') {
              $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
         } elseif ($connection == 'SSL') {
           if (ENABLE_SSL == true) {
             $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
           } else {
             $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
           }
         } else {
               die('</td></tr></table></td></tr></table><br><br><font
            color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
            connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
         }
   }


Now it will elminate http://www.mystore.com/index.php for good.
Kenja
Sorry to post buggy code, but I just realized I have a mistake in the code above. Change

$page == '/';

to $page='/';

when you make the changes.

Also, my solution currently doesn't solve the breadcrumb issue automatically (you still have to do that manually), but I should be able to come up with something similar for that. Will post when I've finished it.


Ken
Kenja
Here's how you fix the breadcrumb problem all in one place.

In catalog/includes/classes/breadcrumb.php, change:
CODE
    
function add($title, $link = '') {
      $this->_trail[] = array('title' => $title, 'link' => $link);
    }


To:
CODE
    function add($title, $link = '') {
      if($link==FILENAME_DEFAULT){
          $link=HTTP_SERVER."/";
      }
      $this->_trail[] = array('title' => $title, 'link' => $link);
    }


Now that all that is finished, I want to automatically redirect anybody (including search engines) that tries to go to index.php with no parameters to the base URL. Any redirect gurus out there that want to help me figure that one out?
matrix2223
The above code does not work for me

Sounds good but dont work
Kenja
QUOTE (matrix2223 @ Apr 27 2006, 10:23 PM) *
The above code does not work for me

Sounds good but dont work


Hi. I can try to help, but you'll have to define what "doesn't work" means exactly. Did you implement one or both modifications? What happens when you do it?
Kenja
Also, to answer my other question above, here are the modifications I used to redirect visitors who come to www.mysite.com/index.php to www.mysite.com/

That will keep the search engines happy that already have index.php in their databases. It ignores index.php calls with parameters, so make sure you install the spider sessions mod and keep it up to date.

The other part of the code redirects people who come to

http://mysite.com

to http://www.mysite.com

That should resolve all the issues.

CODE
<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.mysite.com/ [R=301,L]

</IfModule>
matrix2223
Im sorry but it does work silly me put it in the admin side and with my site the breadcrumbs are change without going to the breadcrumbs.php hey works for me thanks for the help
morganhoff
QUOTE (Reesy @ Aug 1 2005, 04:27 AM) *
Is there any reason why you cant just change FILENAME_DEFAULT to
define('FILENAME_DEFAULT', '/');

Just wondering as it seems a little easier...


Makes sense to me, but did anyone try this? Does anyone have any suggestions why this would be a bad idea?
eww
i'm pretty sure certain modules of osc requiree index.php in this fashion:
index.php?page=2 or something along those lines

but of course trial and error is the best way to see if it works or not smile.gif
sefu
I didnt see this post so I posted a similar question in the support section.
I got a reply and was quoted to do the following which is working for me, its for the bread crumb only though

filename.php

CODE
  $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(''));


comment out the following in html_output.php

CODE
    if (!tep_not_null($page)) {
      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
    }
jlknauff
Ahhh...been looking for this!
matrix2223
QUOTE
I thought of a much cleaner way of implementing this functionality. You won't have to worry about searching your site and changing all the FILENAME_DEFAULT instances to FILENAME_HOME. In fact, you don't have to define FILENAME_HOME. Also you don't have to be anal about checking all new contribs for FILENAME_DEFAULT.

Go to catalog/includes/functions/html_output.php and change
CODE
if ($connection == 'NONSSL') {
      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL == true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
      } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
      }
    } else {
      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
    }


to:
CODE
    if($page == FILENAME_DEFAULT && $parameters=='')  //traps all references to index.php made without any passed parameters like cPath, etc...
       {
        $page == '/';  //Changes the path from 'index.php' to '/'
         if ($connection == 'NONSSL') {
           $link = HTTP_SERVER;
         } elseif ($connection == 'SSL') {
           if (ENABLE_SSL == true) {
             $link = HTTPS_SERVER;
           } else {
             $link = HTTP_SERVER;
           }
         } else {
               die('</td></tr></table></td></tr></table><br><br><font
            color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
            connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
         }
       }
       else
       {
         if ($connection == 'NONSSL') {
              $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
         } elseif ($connection == 'SSL') {
           if (ENABLE_SSL == true) {
             $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
           } else {
             $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
           }
         } else {
               die('</td></tr></table></td></tr></table><br><br><font
            color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine
            connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
         }
   }


Now it will elminate http://www.mystore.com/index.php for good.


Has anyone ever had any problems at all with this code yet? Just asking, I had in before in my store mut moved hosts and never got around to permenitly adding it.

Thanks,
Eric
Kenja
I use it on my site and have been happy with it so far. I did make and correct a typo, so as long as you see that, it will work fine.
matrix2223
QUOTE (Kenja @ Sep 11 2006, 09:06 PM) *
I use it on my site and have been happy with it so far. I did make and correct a typo, so as long as you see that, it will work fine.


Hi Kenja,

I changed the code as you refered to with the typo fix. Nothing happened to any FILENAME_DEFAULT links that I have within my site. They still go to index.php. any ideas, I also have chemos Ultimate SEO URL contrib added.

Heres the link My Webpage

Thanks a bunch,
Eric
Kenja
Based on your earlier post it seems that you had it working before. I'm not sure why it isn't working now. I also use the Ultimate SEO URLs contribution. Did you do the change in the catalog directory? catalog/includes/functions/html_output.php

I'd add the following debug code (see between //Begin Debug and //End Debug).

CODE
if($page == FILENAME_DEFAULT && $parameters=='') //traps all references to index.php made without any passed parameters like cPath, etc...
{
$page = '/'; //Changes the path from 'index.php' to '/'
//begin debug
echo "Got here";
//end debug
if ($connection == 'NONSSL') {
$link = HTTP_SERVER;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL == true) {
$link = HTTPS_SERVER;
} else {
$link = HTTP_SERVER;
}


If the debug statement is reached, I believe it will choke with an error message saying HTML headers have already been sent or something like that. If so, that means you are reaching the code. If not and if the "got here" doesn't appear on the page, you're not reaching the code. If you aren't reaching the code, then try changing:

CODE
if($page == FILENAME_DEFAULT && $parameters=='')

to
CODE
if($page == FILENAME_DEFAULT)


as a test. Be sure to change it back when done testing. Then if that starts throwing the error or you see the "got here" code, you may have some parameters being passed.

That function is called whenever tep_href_link() is called, so I'm not sure why it wouldn't be working for you.
cannuck1964
Here is my htaccess file, it does the front end:

cheers and HTH someone:


CODE
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_php5.c>
php_flag register_long_arrays on
</IfModule>

<IfModule mod_setenvif.c>
  <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
  </IfDefine>
</IfModule>

# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
#
# AcceptPathInfo On

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

<IfModule mod_php4.c>
  php_value session.use_trans_sid 0
  php_value register_globals 1
  php_flag display_errors On
  php_flag track_errors On
</IfModule>

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# Eliminates www vs. non-www
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]

# Eliminates duplicate home page i.e.: www.domain.com/index.php and www.domain.com appear as duplicate home page

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.domain.com/ [R=301,L]

# Skip the next two rewriterules if NOT a spider
RewriteCond %{HTTP_USER_AGENT}!(msnbot¦slurp¦googlebot) [NC]
RewriteRule .* - [S=2]

# case: leading and trailing parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCSid=[0-9a-z]+&(.+)$ [NC]
RewriteRule (.*) $1?%1&%2 [R=301,L]
#
# case: leading-only, trailing-only or no additional parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCSid=[0-9a-z]+$¦^osCSid=[0-9a-z]+&?(.*)$ [NC]
RewriteRule (.*) $1?%1 [R=301,L]


cheers,
Peter M
matrix2223
Thanks Kenja for replying,

The post I had earlier was for a different site, and it did work instantly. I dont have time right now but will make the changes in a few hours and post back with an update.

Im not so sure about using the .htaccess bit being that I have already added stuff to it. Ill put that on the back burner for the moment.

Thanks,
Eric
cannuck1964
QUOTE
Im not so sure about using the .htaccess bit being that I have already added stuff to it. Ill put that on the back burner for the moment.
The htaccess file I posted really does url rewriting. If you have SEO urls installed, the rewrite rules would need to be changed. but generally by replacing the http://www.domain.com/ to have your info and the other areas where you would see that info.

This works well as it also tells the search engine it is a permant move (301). Have questions, I might be able to help some if anyone is interested....

cheers,
peter M
matrix2223
I have just decided to go through and manually change all instances of FILENAME_DEFAULT to '/' so it removes the index.php bit. I know its a lot more work but I have already alot of time in this site.

Thank you to all of you have replied.

Eric
motorcity
QUOTE (matrix2223 @ Sep 16 2006, 11:02 AM) *

Okay I made this mod following the java roaster method with no problems. It brings up a question
however.
I can still type in domain/index.php and go straight to the main page so what about the search engines who might be looking for it? Should I do a redirect? So if you do go to index.php you get redirected to /

Thanks for any insights here.
motorcity
Still hoping someone with some experience would respond to my basic concern here.

Everything about this seems to work except:
If I can still type in http://www.fdsons.com/index.php and go straight to the same main page as http://www.fdsons.com/ ...... why can't the search engines do the same thing?

I tried adding a redirect in the .htaccess like:
Redirect permanent /index.php http://www.fdsons.com/
but that killed the whole website.

I've read through this thread numorous times, it appears the original poster java roaster & misterbling are saying this works without doing anything more to index.php
IS THAT RIGHT???

For anyone else trying to do this I'll add to Java Roaster's list of files to check/change:
shopping_cart.php
logoff.php
gv_redeem.php
cookie_usage.php

-My additions-
about_us.php
shipping.php
all_products.php
(cloned about_us pages of ours, check yours) services.php & overview.php
privacy.php
conditions.php
redirect.php
login.php
create_account_success.php
checkout_success.php

Thanks blink.gif
matrix2223
You basically have to change the code for the back button on all pages that has the link to (FILENAME_DEFAULT) to ('/'). The idea behind this is to get rid of the index.php page and the need for a redirect. Supposidly both are bad from an SEO stand point. Havin the index.php says a duplicate page content, and a redict just looks bad altogether for either a temporary or permenate. If you need help locating the files and code to change this im me or post back here. I will be glad to help you.

Eric
motorcity
QUOTE (matrix2223 @ Nov 21 2006, 04:58 PM) *
Eric

The method I used was what was originally posted by java roast to change all ocurrances of(FILENAME_DEFAULT) to (FILENAME_HOME)
and add
define('FILENAME_HOME', '/');
to the /includes/filesnames.php

I listed every single file I changed in my previous post. It works fine, I can click away all day from my site and never get directed to http:mydomain/index.php (or at least it is never displayed as such).
My question is if I can still type it in to a browser and go to mysite/index.php why would a search engine not still see it as a duplicate?
Does it just fade away after time because nobody but the search engine remembers it?
If Java roaster & misterbling are using a .htaccess redirect like cannuck1964 wrote about, they never mentioned it here.
Are you planning on anything else Eric? Your site does the same thing index.php
just your .com
Maybe its no big deal but I'd sure like to hear something more about it.
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.