ANewComer
ANewComer

Reputation:

Apache Alias/Directory Question

I'm running XAMPP - apache 2.2. I have 200+ folders in http://localhost/examplefolder

I have bought another hdd to load balance the folders, now I have 100+ folders in C:/xampp/htdocs/examplefolder and another 100 folders in D:/examplefolder.

How can I point both directories so that 200+ folders will appear in http://localhost/examplefolder ?

I don't want it to have different folder name.

Upvotes: 0

Views: 1170

Answers (2)

Jakub
Jakub

Reputation: 20475

vHosts won't get you where you want to go, if I can clarify the question you want to show folder contents from both folders from different drives in one 'web folder'?

You could get around this by just adding the 2nd folder as an alias, and having 100+ in one folder and a link to the other 100+.

However, I would question WHY you want 100+ folders in one 'folder', this is getting messy, and I would assume hard to find thing, unless this is a user structure or some form of organization: folders a-z, etc;

Upvotes: 0

Amr Mostafa
Amr Mostafa

Reputation: 999

The answer depends on your final environment/application. Ideally, you should try RAID 0 which will transparently distributes your folders amongst the two harddisks, however, your applications will be accessing them as if they were just one big hard drive. In a bigger thing, you should consider distributed file system.

Having that said, you could achieve what you want using mod_rewrite. Basically, you will check the existence of the requested URI, if it exists, fine, let it through. If it doesn't, you will rewrite the C:/xmpp/htdocs/examplefolder part to become D:/examplefolder.

Upvotes: 1

Related Questions