Alias directive in Apache 1.3.22
Hopefully this is a simple question. I have a directory that is called docs, which is not in my regular DoumentRoot of my website. I have created and Alias that points to like so:
Alias /docs/ “/usr/local/docs/” This works fine as long as I type: www.mydomain.com/docs/ but if I of course only type: www.mydomain.com/docs it does not work. I read the information that protein to the mod_alias directive, which states that if you Alias has a trailing / it is required for the end-user to type in exactly that way. I thought to myself that this is understandable, but I need to be able to except it URL without the trailing / as well. I then went back in the conf file that defines the Alias and added another Alias right under that one without the trailing /. In my thinking this should work, but for some reason it does not. I then just modified the original Alias to not include the trailing /, but that does not seem to work either. I’m not sure if I am explaining this right or not, but to make a long story short, I would like for below statements to get to the same place: www.mydomain.com/docs/ www.mydomain.com/docs The only difference is the trailing “/”. There has got to be something simple, because I have put entirely to much time in trying to figure this out. Please Help!!!!!! |
If you read your httpd.conf file is says,
'Note that if you include a trailing / on fakename then the server will require it to be present in the URL. So "/icons" isn't aliased in this example, only "/icons/". If the fakename is slash-terminated, then the realname must also be slash terminated, and if the fakename omits the trailing slash, the realname must also omit it.' So you need to put both, Alias /docs/ “/usr/local/docs/” Alias /docs “/usr/local/docs” Hope this helps |
Or you could use the Options directive to specify Indexes. That way you don't have to keep creating double aliases for everything.
|
All times are GMT -5. The time now is 11:36 PM. |