![]() |
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. |
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/"); To make the html_catalog file automatically copy the generated html files over once its done. |
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. |
Quote:
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 |
Gotcha. So 755 should do the trick right?
|
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 |
Re: Root HTML Generator
Quote:
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:
|
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 |
Re: not so simple
Quote:
Look for this instead: Code:
define ('DIR_CATALOG', '/catalog'); Carrie |
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 |
Re: not quite root
Quote:
Hi, Robert: As your XCart is installed in /public_html/store directory, XCart can not access any directory above the directory /store. If you want all your HTML files in /public_html (web root) directory, you either install your XCart in this directory, or use a commercial mod to move the HTML files up into /public_html (web root) directory. |
Thanks for your prompt reply.
Is it OK to have your cart and the html pages in the root directory? I mean, does it cause any conflicts? Thanks again Robert |
Quote:
Doesn't cause any conflicts. You can also change it to: Code:
define ('DIR_CATALOG', '/'); and see if that puts it in the xcart directory. I've not tried myself so I'm not sure if that will make it go into the xcart directory. Carrie |
Quote:
Hi, Robert: No, it doesn't cause any conflicts at all. |
Hi Carrie
Tried putting in the'/' and it shows that it will write the html to: The server directory where the HTML-catalog will be generated: /public_html/store/ You will access your HTML-catalog via this URL: http://www.officeline.co.uk/store//index.html Now I'm stuck. I guess I'll just create the cart in the root directory and html to there. Robert |
Quote:
Maybe you can use: define ('DIR_CATALOG', ''); and see if you can get rid of double // . I've not tried myself. Quote:
|
Hello,
Is it possible to configure this mod to generate an HTML catalog to another folder as well? For example, the html catalog can get generated into the catalog folder, as well as the "categories" folder depending on which path I type in through the admin. Sometimes I want to generate just the categories HTML pages and be able to find all of them at once. When you have thousands of products and HTML pages get generated by category only, it would be impossible to find all the category pages. I also don't want to delete the product html pages. If it's possible to be able to generate the HTML catalog in 2 different folders, I can generate the category pages in the "categories" folder whenever I want without having to delete everything. Can anyone help? |
Hi, Robert:
You can generate the HTML catalog files in the catalog directory, then copy any files you like in the catalog directory to any other diretories. |
Hi all, as my xcart is in the root directory ive just tried this little mod
and created my catalog in public_html, i use a company called http://optimiser.123promotion.co.uk/ before i created my catalog in the root i had a 77% ranking score, ive just re-tested and ive know got a ranking score of 82% and just by following this little mod. Cheers Jon and all you guys. |
limit on viewable files in ftp programs
Does anyone know why there is a limit to the number of files that you can view using FTP programs.
I'm using Ipswitch FTP and it only allows me to see the first 2000 files in any directory? Not much good if I want to copy 16,000 files from /catalog to the root folder of my store. Any ideas? Thanks Rob |
Hi, Rob:
If your site has 16,000 files, you will be tired to copy all these files everyday to update your site. You can either create a cron job to do it for you at a pre-defined time or modify your HTML catalog routing to copy the HTML files into your web root directory everytime when you create your HTML catalog files. |
Hello,
I too am trying to generating my store in HTML with the catalogue being placed into the root directory. I am using v4.0.7 and have the store in my root directory not customer or xcart. I have located the code to modify of ('DIR_CATALOG', '/catalog'); within my html_catalogue.php file. I have changed this to define ('DIR_CATALOG', ''); This section is fine and it shows my url would be www.giftandhomewarehouse.com.au/index.html However when I try to generate the catalogue I receive an error stating: "No languages are selected" I have tried adding a / to the english language box but this then generates a php script error as it is trying to write www.giftandhomewarehouse.com.au//index.html Notice the double // but this only occurs when I have to enter the lanague area path. What other item can I put in the english lanague option so this generates to the root? Im stumped on this one. Hope someone can offer so guidance with this please, I would be most greatful. |
Quote:
Look in the area where you generate the catalog. You will see languages listed close to the bottom with the white boxes next to them Simply place Code:
/catalog PS, forgot to say ONLY next to YOUR language! Leave all of the others blank |
Hello Markwhoo,
Thanks for your fast reply i do appreciate it. Just want to confirm that with your advice to put /catalog in the language box, should I still use /catalog even though I want it to go into the root directory and not in catalog? Look forward to hearing from you soon. |
Quote:
If you have installed the store into the main web directorythen the slash should do it. If you add " /catalog " This would add the html files into xcart root folder/catalog. So, make sure you have defined catalog as " " and add the slash, try it and see, this should work. |
Catalog Generating Problem
Hi Ghhoz
I had issues with the catalog generator over Christmas/New Year. Here is my post - have a read and see if you have/had the same issue: http://forum.x-cart.com/viewtopic.php?t=15826&highlight= I hope it helps prevent a problem in the future. Regards Ing. Stephen Hatton :idea: |
hmmm XC forces the //index.html (etc) into the file, so when you look at the pages they are displayed as:
www.domain.com//index.html - As mentioned above in this thread. It doesnt matter if you make this define like the following: Code:
define ('DIR_CATALOG', ''); If you leave the language empty, you get the usual error. I have looked through the code but cant figure why XC is doing this. You cant generate the pages in /catalog and move to route as the code is already in the html pages, all links will point to /catalog/xxx.html The forced second / needs to be removed for this to work correctly. Nice idea too I must say. ;) Fix that and place it on a cron job and this will be nice and speedy! :D |
Just a quick addition.
The 2nd / is added all the way through the html_catalog.php file. So they either all need removing... :? Or the languages field you have to select in admin needs to be allowed to process if left empty. |
interesting...
html_catalog.php includes this code: Code:
# If only one language, then remove the "select language" form Now as we only have one language and the others are disabled I would have thought this code should have kicked in, but it doesnt... |
Languages
Hi CC
You have more than one Language installed - One enabled, the others disabled. If you delete the disabled ones, then you will have one language and the script will "kick in". Just though I would mention it for others (just in case you didn't realise it after you hit the submit button). Regards Ing Stephen Hatton :idea: |
Argh ok that makes sense, although not very good.
This would have been better written to work with disabled/non-installed languages I think... The fact you have to delete it is not good. |
Ok, just backed up and deleted German, French and Swedish as we dont need these, and still it asks for the language. :lol:
And around I turn to go back to the drawing board... |
I haven't tried this so just consider it a suggestion:
admin/html_catalog.php change lines 360-361 from: Code:
if ((filetype ($catdir["path"]."/".$file) != "dir")) { Code:
if ((filetype ($catdir["path"]."".$file) != "dir")) { |
Already attempted this, same result the double // lives! :wink:
It's one of those bits of code where you know the answer is simple enough if only you could be arsed to sit there long enough to work it out. I really need to, as the html catalog in root would be a huge bonus. But I dont want to be indexed with // URL's, it looks poor if nothing else. |
Hmmm.. I kinda like having my html pages in a seperate folder, but I put my index.html in the root folder, that way when I make changes to my store the customer isn't aware since they are riding on the html pages. And after I make the changes, I delete the index.html and the customer rides the .php pages while my html's are generating.
As far as indexing goes, I am in probably one of the most competative businesses going and my pages are starting to get indexed very well. The problem is not in the html files being outside of the root folder. There are many drawbacks to Xcart when it comes to SEO and it would take me a few days to explain it all. But I had to totally re-re my whole cart to get it to index properly. You see, one of the first things the spiders go for is cart.php and then the search results page can actually destroy your chances of getting indexed! I have reworked this for myself solving the problem, but before that, NO INDEXING. The standard XCart takes the spider for quite a ride before they get to your html pages and some search engines will only index 400 pages. The search results page alone will eat that up before ever getting to a product! Putting the html's in the root may or may not solve this but it won't solve the way spiders go through your cart. XCart should hire an SEO company to rework the cart. I can show them how to fix it but they will have to purchase a support ticket from me. 8) |
Indexing is not something we suffer from, we get indexed very highly, particularly by Google.
What we really need is the speed from the html catalog for our customers. But I dont want to jepordise our indexing for speed, so I need to fix some issues first with this root install. |
html catalog javascript 4.0.1
I read this thread as I have the same problem with // while generating html files. However, when checking links in the code once generated all links are with only one / which is fine I guess.
My main questions is: I have not used x-cart for a while and noticed with the 4.x version that the html generates javascript in the head of each html page. Does anyone know its purpose and if it is necessary? Thanks for the hints. Cheers 4.0.11 Red Hat 9.0 |
It's been so long since I dealt with that (js in the head section) I believe it is a browser check. Anyway, it's no good for SEO but a must have for the site.
|
So Why doesnt X-cart solve the concern/..............
Am I stupid or what...
simple question...: why doesn't x-cart solve the SEO/catalog BS by writing a snippet of code that can be run as stand-alone or absolved into the cart itself that will write the catalog static html to the root (given proper root configurations that is) problem solved... anyway I have 5 sites that I webmaster and all of them are running the catalog generated index in the root and the rest in the catalog directory....all works fine...and seems to spider ok... true all in root is much better...you would think that x-cart would solve this issue...would be a big boost to the software... |
How did you solve this? please share with us Will you?
|
All times are GMT -8. The time now is 07:38 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.