trailing slash problem; APACHE 1.3
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Windows > trailing slash problem; APACHE 1.3




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    trailing slash problem; APACHE 1.3  
Thomas Wideman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-11-04 11: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





[ Post a follow-up to this message ]



    Re: trailing slash problem; APACHE 1.3  
Thor Kottelin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-11-04 11: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/





[ Post a follow-up to this message ]



    Re: trailing slash problem; APACHE 1.3  
Jim Patterson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-11-04 04:37 PM

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





[ Post a follow-up to this message ]



    Re: trailing slash problem; APACHE 1.3  
Thomas Wideman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-11-04 07: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 you
r
> 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.





[ Post a follow-up to this message ]



    Re: trailing slash problem; APACHE 1.3  
Thor Kottelin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-11-04 10: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/





[ Post a follow-up to this message ]



    Re: trailing slash problem; APACHE 1.3  
Thomas Wideman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-12-04 08: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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:41 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register