This is a discussion on trailing slash problem; APACHE 1.3 within the Windows Web Servers forums, part of the Web Server and Related Forums category; Yeah hi, we've all had the trailing slash problem with Apache. Well I just set up my own web ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Yeah hi, we've all had the trailing slash problem with Apache. Well I
just set up my own web server and am encountering it again. I know how to fix the problem with Aliases, but is there a dynamic way to fix the thing? Say the URL is HTTP://mysite/somedir/ but if some one puts in HTTP://mysite/somedir it will forward it to the correct dir without haveing to specify each individual one? You help would be most appriciated, Nano2e |
|
|||
|
Thomas Wideman wrote: > > Yeah hi, we've all had the trailing slash problem with Apache. Well I > just set up my own web server and am encountering it again. I know > how to fix the problem with Aliases, but is there a dynamic way to fix > the thing? Say the URL is HTTP://mysite/somedir/ but if some one puts > in HTTP://mysite/somedir it will forward it to the correct dir without > haveing to specify each individual one? I don't know exactly what you mean, but I assume you want to rewrite web addresses, so I suggest looking at mod_rewrite. If this doesn't answer your question, please explain precisely what it is you want to do. Thor -- http://thorweb.anta.net/ |
|
|||
|
Thomas Wideman wrote:
> Yeah hi, we've all had the trailing slash problem with Apache. Well I > just set up my own web server and am encountering it again. I know > how to fix the problem with Aliases, but is there a dynamic way to fix > the thing? Say the URL is HTTP://mysite/somedir/ but if some one puts > in HTTP://mysite/somedir it will forward it to the correct dir without > haveing to specify each individual one? > > You help would be most appriciated, I usually just use AliasMatch / ScriptAliasMatch instead. E.g. AliasMatch ^/somedir($|/.*) C:/Site/somedir$1 That at least keeps the "fix" in a single specification. Note that this syntax seems to confuse some versions of Apache, though. -- Jim Patterson Ottawa, CANADA |
|
|||
|
> I don't know exactly what you mean, but I assume you want to rewrite web
> addresses, so I suggest looking at mod_rewrite. If this doesn't answer your > question, please explain precisely what it is you want to do. > > Thor I have never looked at mod_rewrite before. I will have to check it out... What I mean... I know that I can put in an Alias for each individual dir name e.g. mysite.com/somedir into mysite.com/somedir/ mysite.com/somedir1 into mysite.com/somedir1/ mysite.com/somedir2 into mysite.com/somedir2/ But I want to know how to make Apache redirect to mysite.com/* to mysite.com/*/ so that if I had an FTP server for my users to upload i wouldn't have to enter any new config commands. |
|
|||
|
Thomas Wideman wrote: > I want to know how to make Apache redirect to mysite.com/* to > mysite.com/*/ > so that if I had an FTP server for my users to upload i wouldn't have > to enter any new config commands. Apache normally does this. For example, if I enter <URL:http://thorweb.anta.net/irt>, Apache redirects me to <URL:http://thorweb.anta.net/irt/>. If, for some reason, it doesn't work, you should be able to force it using RedirectMatch or RewriteRule. If you use the latter, remember to also set RewriteEngine on. Thor -- http://thorweb.anta.net/ |
|
|||
|
>
> I usually just use AliasMatch / ScriptAliasMatch instead. E.g. > > AliasMatch ^/somedir($|/.*) C:/Site/somedir$1 > > That at least keeps the "fix" in a single specification. Note that this > syntax seems to confuse some versions of Apache, though. Yeah, I've used AliasMatches before...but I want it to be compleatly hands-free if you know what I mean...I think I'll try getting deeper into the ReRight Modual. I am pretty sure that it will do what I want...but man is it confusing...15 pages of documentation!!! Thanks for your help. Nano2e |