X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Root HTML Generator (https://forum.x-cart.com/showthread.php?t=10401)

Jon 11-15-2004 08:57 PM

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.

B00MER 11-16-2004 07:47 AM

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.

Jon 11-16-2004 09:24 AM

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.

BCSE 11-16-2004 10:18 AM

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

Jon 11-16-2004 10:20 AM

Gotcha. So 755 should do the trick right?

BCSE 11-16-2004 10:24 AM

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

Yang Xu 11-17-2004 10:39 PM

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.

rmaskell 11-19-2004 08:23 AM

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

BCSE 11-19-2004 10:04 AM

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

rmaskell 11-21-2004 11:27 PM

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


All times are GMT -8. The time now is 06:03 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.