Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

change home.php to index.php

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-29-2007, 03:49 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default change home.php to index.php

I want my cart to be accessed by example.com/index.php, instead of home.php.


I can see the breadcrumb for Store Name links to home.php, how would you change that to index.php instead?

Also is there anywhere else in the store that will send you to home.php that will have to be modified?
__________________
v4.1.8 GOLD
Reply With Quote
  #2  
Old 07-29-2007, 05:21 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: change home.php to index.php

You really can't do that, it is hard coded everywhere in the php files. You should always link your site by just the domain name anyway, so no one will see home.php until they get into the store, and even then you should have a url rewrite mod in place. So no one will ever actually see home.php.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 07-29-2007, 09:51 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: change home.php to index.php

I have copied home.php code to index.php, which loads the site fine when I access example.com/index.php .

Along with :

Code:
DirectoryIndex index.php

in .htaccess will get example.com to load the site correctly.

or you can not even place the code from home.php into index.php and place this in .htaccess:

Code:
DirectoryIndex home.php

will allow you to load www.example.com but really be using home.php.

The problem lies in the home.php links throughout the source code. I am not sure there is a server configuration possible to change to index.php in the program without taking every reference out of the source.

Now for mod_rewrite I placed :

Code:
RewriteEngine on RewriteRule ^home\.php$ index.php


I ran grep on x-cart dir, and there are many files to with home.php written out, with mod_rewrite (best to my knowledge of it), it is useful to make rules in .htaccess based in conjunction with dynamic url printing in the source code.

So will I have to change home.php in every single file to index.php anyway I guess?
__________________
v4.1.8 GOLD
Reply With Quote
  #4  
Old 07-29-2007, 10:28 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: change home.php to index.php

We provide an SEO Links mod that will rewrite all references of http://www.yourdomain.com/home.php to http://www.yourdomain.com/ which is optimal for seo.

Mod details can be viewed at:
http://www.websitecm.com/x-cart-mods/x-cart-seo-links.html
Reply With Quote
  #5  
Old 07-29-2007, 11:16 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: change home.php to index.php

Jon: Your mod changes home.php urls to what ? and is it automatically done with the default install?
__________________
v4.1.8 GOLD
Reply With Quote
  #6  
Old 07-30-2007, 09:03 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: change home.php to index.php

It changes home.php to / and is automatically done. You then put "DirectoryIndex home.php" in an .htaccess file and your site loads directly without ever calling home.php directory.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:25 AM.

   

 
X-Cart forums © 2001-2020