Webmastersite.net
Register Log In

How to regenrate 138K categories
Regenerating issues with 138K categories

Comments on How to regenrate 138K categories

shlomot
To the here and now !

Usergroup: Customer
Joined: Feb 06, 2008
Location: Haifa, Israel

Total Topics: 15
Total Comments: 49
shlomot
Posted Jul 28, 2009 - 8:32 AM:

Hello,


After many tests, I have inserted over 138,000 categories to the wsnlinks_categories table, after acertaining that they contain the exact same information as if they were created via the WSN user interface.


Still, the categories require regeneration, mainly in order to update counters, and most importantly - the .htaccess file.


However, the regeneration process takes forever, and will most likely end with internet connecativity errors or the like. Just as an example, it takes ten full minutes to have this status line presented: Updating next batch of categories starting at 47 (out of 138192)...


Are there any shortcuts to this agonizing process, such as using only the counters and routing table scripts? We are planning to have half a million categories by the end of this year.

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 28, 2009 - 3:30 PM:

Regenerating categories does not update the .htaccess file. Not sure why you'd expect it to. Submitting the SEO settings page or running an upgrade updates the .htaccess file.

Counts should only become inaccurate if you move subcategories around. I'll add a link to the edit category page for regenerating just a particular category for those situations.
shlomot
To the here and now !

Usergroup: Customer
Joined: Feb 06, 2008
Location: Haifa, Israel

Total Topics: 15
Total Comments: 49
shlomot
Posted Jul 29, 2009 - 12:40 AM:

The facts, Paul are:

1. Before running the regeneration process - the newly inserted category is inaccessible via friendly URL.

2. After running the regeneration process - the category becomes accessible via friendly URL.

3. I see no difference in the content of the category record before and after the regeneration process.

4. After the regeneration process, I see two new lines in .htaccess:

RewriteRule ^sada-thompson-links/([0-9]+).html$ index.php?rewritten=1&action=displaycat&catid=544510&page=$1
RewriteRule ^sada-thompson-links/$ index.php?rewritten=1&action=displaycat&catid=544510

5. I tried to follow your guide above and re-submit the SEO setting page, but I'm getting the following error:
Fatal error: Maximum execution time of 90 seconds exceeded in C:\Inetpub\vhosts\celebrities-galore.com\httpdocs\directory\databases\mysql.php on line 38

6. I could obviously set off the "Auto-write .htaccess?" setting, compile the file on my localhost and copy it to the web server. But here comes another question to mind: is an .htacess file with millions of derivative lines (eventually) is a feasible solution at all? This file is being loaded by the server and interpreted with each requested document. It seems like an impossible overload to the server and an invitation for disasters to happen.

A possible solution may be that you would instruct me how to write the customurl in a way that will include the Category ID, and you will suggest how to replace the two liners per category in the htaccess file to a single (or a few) lines of instructions for all the categories.

Please help.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 29, 2009 - 8:59 AM:

1. Before running the regeneration process - the newly inserted category is inaccessible via friendly URL.

2. After running the regeneration process - the category becomes accessible via friendly URL.


That's just not possible in 5.0.59. Editing or adding a category does cause the .htaccess to be regenerated, though it's certainly not the recommended method. So does updating switches. Regeneration does not.

is an .htacess file with millions of derivative lines (eventually) is a feasible solution at all?

No, that would presumably slow your web server to a crawl.

A possible solution may be that you would instruct me how to write the customurl in a way that will include the Category ID

{CATREWRITEPATH}-{CATID}/{PAGE}.htm l is a simple example of a rewrite scheme containing the category id that should work. I need you to tell me what you want since there are an infinite number of possible schemes that would include an id.
shlomot
To the here and now !

Usergroup: Customer
Joined: Feb 06, 2008
Location: Haifa, Israel

Total Topics: 15
Total Comments: 49
shlomot
Posted Jul 29, 2009 - 9:15 AM:

For Britney Spears, the friendly URL shows now: directory.celebrities-galor....com/britney-spears-links/

Category ID = 544563

I would like to keep the keywords "britney-spears" and "links" in the URL.

The rest is up to your preferences. Just please advise not only about the required settings on the "Search Engine Optimization Settings" page, but also what lines should be written into the .htaccess file instead of the individual lines that are written now per each category.

Thanks a lot.
shlomot
To the here and now !

Usergroup: Customer
Joined: Feb 06, 2008
Location: Haifa, Israel

Total Topics: 15
Total Comments: 49
shlomot
Posted Jul 31, 2009 - 3:16 AM:

OK, Paul. I believe I managed to take your advise to closure.

Here's what I've done:

On "Search Engine Optimization Settings" page
1. Set "Auto-write .htaccess?" to "No";
2. Set "Format for category rewriting:" to: celebrities/{CATID}-{CATREWRITEPATH}/{PAGE}/


In htaccess:
Replaced individual category rules with the following two lines:

# Category Rules:
# ===============
RewriteRule ^celebrities/([0-9]+)-(.*)/([0-9]+)/$ index.php?rewritten=1&action=displaycat&catid=$1&page=$3 [PT, NC, L]
RewriteRule ^celebrities/([0-9]+)-(.*)/$ index.php?rewritten=1&action=displaycat&catid=$1 [PT, NC, L]


In wsnlinks_categories table:
Empties the field "specialurl".

Thanks, Paul for your support.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 31, 2009 - 3:30 PM:

shlomot wrote:
Just please advise not only about the required settings on the "Search Engine Optimization Settings" page, but also what lines should be written into the .htaccess file instead of the individual lines that are written now per each category.


Please don't modify the .htaccess file. Let the software do that. It's like writing HTML pages by hand instead of letting the script generate them, it defeats the purpose of using software.

1. Set "Auto-write .htaccess?" to "No";

Please don't set this. The option is only there for the sake of people on Windows IIS servers which may have some other .htaccess alternative. I'll try hiding it from everyone else in the future, I guess.

The rewrite scheme I gave above, {CATREWRITEPATH}-{CATID}/{PAGE}.html, fits what you've said you want and works a lot more reliably.

Though it's not clear why you want ids in the URLs in the first place -- the only point of including the id is if you have special foreign characters to handle, which your example suggests you don't.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.