trailing slash problem; APACHE 1.3

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


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-11-2004
Thomas Wideman
 
Posts: n/a
Default trailing slash problem; APACHE 1.3

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
  #2 (permalink)  
Old 02-11-2004
Thor Kottelin
 
Posts: n/a
Default Re: trailing slash problem; APACHE 1.3



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/
  #3 (permalink)  
Old 02-12-2004
Jim Patterson
 
Posts: n/a
Default Re: trailing slash problem; APACHE 1.3

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
  #4 (permalink)  
Old 02-12-2004
Thomas Wideman
 
Posts: n/a
Default Re: trailing slash problem; APACHE 1.3

> 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.
  #5 (permalink)  
Old 02-12-2004
Thor Kottelin
 
Posts: n/a
Default Re: trailing slash problem; APACHE 1.3



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/
  #6 (permalink)  
Old 02-12-2004
Thomas Wideman
 
Posts: n/a
Default Re: trailing slash problem; APACHE 1.3

>
> 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0