By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

mod_rewrite help: More than 32000 directories on Linux problem?

P: n/a
Hello,

I am running RedHat & Apache. RedHat does not allow creating more
that 32000 subdirectories in one folder due to #defined constant
limitation in the core code.

I need to display 47000 directories on web page:
e.g. mydomain.com/andrew , mydomain.com/bill , etc. Each directory
contains .html/htm files and image files (*.jpg, *gif, jpeg etc.)

The directory structure has been created previosly some time ago and
worked perfectly on WinNT machine untill now. Modifying HTML seems to
be a big job to do.

Can anyone suggest a solution using mod_rewrite?

Thanks!

Dgrand
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Support <di***@my-deja.com> wrote:
I am running RedHat & Apache. RedHat does not allow creating more
that 32000 subdirectories in one folder due to #defined constant
limitation in the core code.
What filesystem are you using?
I need to display 47000 directories on web page:
e.g. mydomain.com/andrew , mydomain.com/bill , etc. [snip]
Modifying HTML seems to be a big job to do.
No kidding :)

But a regexp equivalent to the rule below seems to be more efficient
than using the rewritengine.
Can anyone suggest a solution using mod_rewrite?


A simple workaround would be to reorganize directories like:
/a/andrew
or
/b/i/bill

With the rewrite engine it would become something like:
RewriteRule ^(.)(.*) /$1/$1$2

You'll need to lookup the exact syntax yourself :)

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
Daniel Tryba <ne****************@canopus.nl> wrote:
No kidding :)

But a regexp equivalent to the rule below seems to be more efficient
than using the rewritengine.

(forgot half the sentence)
So spending some time to figure out how to edit the html might be the
longterm goal. Using sed/awk/perl/php or some other scripting magic to
rewrite href or img attributes shouldn't be to difficult eiter.

--

Daniel Tryba

Jul 17 '05 #3

P: n/a
Daniel,

thank you for the reply. That ia what I am doing now - moving all the
stuff into /a/andrew ; /b/bill etc. Anybody knows exact syntax for
Mod_rewrite for this sort of directory arrangment?
RewriteRule ^(.)(.*) /$1/$1$2
I've tried
RewriteRule ^([a-zA-Z]{1})(.*)$ /$1/$1$2 [L]
does not seem to work

DgranD

Daniel Tryba <ne****************@canopus.nl> wrote in message news:<cl**********@news.tue.nl>... Support <di***@my-deja.com> wrote:
I am running RedHat & Apache. RedHat does not allow creating more
that 32000 subdirectories in one folder due to #defined constant
limitation in the core code.


What filesystem are you using?
I need to display 47000 directories on web page:
e.g. mydomain.com/andrew , mydomain.com/bill , etc.

[snip]
Modifying HTML seems to be a big job to do.


No kidding :)

But a regexp equivalent to the rule below seems to be more efficient
than using the rewritengine.
Can anyone suggest a solution using mod_rewrite?


A simple workaround would be to reorganize directories like:
/a/andrew
or
/b/i/bill

With the rewrite engine it would become something like:
RewriteRule ^(.)(.*) /$1/$1$2

You'll need to lookup the exact syntax yourself :)

Jul 17 '05 #4

P: n/a
"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:cl**********@news.tue.nl...
Support <di***@my-deja.com> wrote:
I am running RedHat & Apache. RedHat does not allow creating more
that 32000 subdirectories in one folder due to #defined constant
limitation in the core code.


What filesystem are you using?
I need to display 47000 directories on web page:
e.g. mydomain.com/andrew , mydomain.com/bill , etc.

[snip]
Modifying HTML seems to be a big job to do.


No kidding :)

But a regexp equivalent to the rule below seems to be more efficient
than using the rewritengine.
Can anyone suggest a solution using mod_rewrite?


A simple workaround would be to reorganize directories like:
/a/andrew
or
/b/i/bill

With the rewrite engine it would become something like:
RewriteRule ^(.)(.*) /$1/$1$2


Or to reduce the amount of directory reorganization, just split them up into
two folders:

RewriteRule ^([a-j].*) /a-j/$1
RewriteRule ^(.*) /the-rest/$1
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.