Web Servers on Windows - trailing slash problem; APACHE 1.3

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Windows > February 2004 > trailing slash problem; APACHE 1.3





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author trailing slash problem; APACHE 1.3
Thomas Wideman

2004-02-11, 6:40 am

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
Thor Kottelin

2004-02-11, 6:40 am



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/
Jim Patterson

2004-02-11, 11:37 am

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
Thomas Wideman

2004-02-11, 2:38 pm

> 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.
Thor Kottelin

2004-02-11, 5:36 pm



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/
Thomas Wideman

2004-02-12, 3:39 am

>
> 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
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com