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

Root HTML Generator

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-15-2004, 08:57 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default Root HTML Generator

I've had a few people asking me this question so I thought I'd post it up for others.

It's a very simple mod to do, but it is very effective. It basically moves your catalog .html pages into your root directory i.e. http://www.yourdomain.com/index.html instead of http://www.yourdomain.com/catalog/index.html

It makes your site much more likely to be spidered by search engines, and increases page rankings by moving them a step closer to root.

----

1) Download and open the file admin/html_catalog.php in a text editor

Find this code:

Code:
$catalog_dir_name = "catalog";

Change to:

Code:
$catalog_dir_name = "";

2) Reupload your file.

3) You will then have to give your root directory permission to be written to. This will likely require the directory being chmod'd 666 or 777. Look up "chmod" on the search engines if you are unsure how to do this.

4) You can then login to your admin section, click on HTML Catalog, and generate your new catalog. An index page will be created for your site.

---

That's all there is to it.
Reply With Quote
  #2  
Old 11-16-2004, 07:47 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

This is really only good for those who run private or dedicated boxes, setting chmod 666 or 777 to your public_html or xcart directory would allow anyone on the shared box to do whatever they like with your files. If this is the case, you can always do something like this after the end of the html catalog generation php file:

Code:
@exec("cp /path/to/xcart/catalog/* /path/to/xcart/");
(not tested)

To make the html_catalog file automatically copy the generated html files over once its done.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 11-16-2004, 09:24 AM
  Jon's Avatar 
Jon Jon is offline
 

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

Default

Thanks Boomer. I've been on a dedicated box for so long I didn't realize that. I'd assume that the user group permissions would prevent that?

You could also chmod the folder, generate the catalog, and then chmod it back.
Reply With Quote
  #4  
Old 11-16-2004, 10:18 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,064
 

Default

Quote:
Originally Posted by Jon
Thanks Boomer. I've been on a dedicated box for so long I didn't realize that. I'd assume that the user group permissions would prevent that?

You could also chmod the folder, generate the catalog, and then chmod it back.

Well, with 777 or 666 you're giving
User
Group
Other <-----

Read write (and execute with 777) permissions. So anyone who can log into the machine could write in a directory with 777 permissions.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #5  
Old 11-16-2004, 10:20 AM
  Jon's Avatar 
Jon Jon is offline
 

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

Default

Gotcha. So 755 should do the trick right?
Reply With Quote
  #6  
Old 11-16-2004, 10:24 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,064
 

Default

It actually depends on the server set up if 755 would work or not. So hard to say overall. That's why X-cart creates catalog directory with 777 permissions.

So to put html catalog in root, would be best if a copy script were run or something like what Jared suggested. Or go in and chmod to 777 then back to 755 after done. But if you generate your catalog as often as I do, you wouldn't want to do that every time.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #7  
Old 11-17-2004, 10:39 PM
 
Yang Xu Yang Xu is offline
 

Senior Member
  
Join Date: May 2004
Location: Portland, Oregon
Posts: 175
 

Default Re: Root HTML Generator

Quote:
Originally Posted by Jon
It's a very simple mod to do, but it is very effective. It basically moves your catalog .html pages into your root directory i.e. http://www.yourdomain.com/index.html instead of http://www.yourdomain.com/catalog/index.html.

This method is only for the shops which are installed in the web root directory. But most of the shops (or default XCart setup) is on http://www.yourdomain.com/xcart/, so the method you use will create HTML codes in http://www.yourdomain.com/xcart/. You can only use as http://www.yourdomain.com/xcart/index.html

Quote:
It makes your site much more likely to be spidered by search engines, and increases page rankings by moving them a step closer to root.
You are absulutely right! But only when the HTML codes are in the Web Root directory.
__________________
Carts n Tools.com
- New Root HTML Generator
- Templates | Add-Ons | Services
- XCart 4.0.x
Reply With Quote
  #8  
Old 11-19-2004, 08:23 AM
 
rmaskell rmaskell is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: UK
Posts: 69
 

Default not so simple

It sounded simple until I tried looking for the $catalog_dir_name = "catalog"; in the admin/html_catalog.php file.

I'm using Gold v.4.0.6 and can't find this line?

Any ideas?

Robert
__________________
www.officeline.co.uk
X-Cart v4.0.17
Reply With Quote
  #9  
Old 11-19-2004, 10:04 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,064
 

Default Re: not so simple

Quote:
Originally Posted by rmaskell
It sounded simple until I tried looking for the $catalog_dir_name = "catalog"; in the admin/html_catalog.php file.

I'm using Gold v.4.0.6 and can't find this line?

Any ideas?

Robert

Look for this instead:
Code:
define ('DIR_CATALOG', '/catalog');


Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #10  
Old 11-21-2004, 11:27 PM
 
rmaskell rmaskell is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: UK
Posts: 69
 

Default not quite root

I change the line define ('DIR_CATALOG', '/catalog'); to read ('DIR_CATALOG', ''); but it then wants to put the hmtl pages in /public_html/store rather than in the root directory /public_html ?

I have the ordinary files in the /public_html/store directory.

Any ideas?

Thanks

Robert
__________________
www.officeline.co.uk
X-Cart v4.0.17
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 01:59 PM.

   

 
X-Cart forums © 2001-2020