1

Apologies if I missed it in a search but I'm bad at search terms and didn't find anything that is exactly what I need.

Our servers run Apache and for a stack I'm setting up, they want the following URL pattern

www.[sitename]/[subdirectory]

Where [sitename] is common to a number of stacks and [subdirectory] is unique to each stack.

For the other stacks that were set up, the Apache filesystem roots were set up to be

/files/[stackname]/[subdirectory]

Where the root of Apache was set to [stackname] so Apache would require the subdirectory to be in the requested URL to actually pull the site.

I made a case that there's got to be a better way for subsites to function rather than creating subdirectories on the file system; my main issue is that a lot of the scripts and Jenkins we used don't work with the additional filesystem-level subdirectory and we keep having to hardcode more and more exceptions and I'm not about that.

So in summary: in Apache, what options should I look at to force www.[sitename]/[subdirectory] to load my specific site?

Please comment if you need clarification, it's very early morning but this has been keeping me up all night; I feel like there's an easy way to do it, but I might be overthinking the problem and incorrectly searching.

1 Answer 1

0

If you want to do it in wholly in httpd, then use Alias. If you have dynamic requirements, look at using .htaccess in your document root to add and remove URI paths to your URLs.

If you want more control, there should be a way of managing URLs in your programming language of choice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .