You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Søren Neigaard <s....@mobilethink.dk> on 2002/04/12 13:38:43 UTC

Need help with /

Hi

I have the following VirtualHost:

<VirtualHost www.tdcmobil.dk>
#  RewriteEngine on
#  RewriteRule /erhverv$ /erhverv/
  ProxyRequests Off
  ProxyPass /my/CM/ http://PROXY_IP/my/CM/
  ProxyPass /my/CMGrafik/ http://PROXY_IP/my/CMGrafik/
  ProxyPass /my/CSS/ http://PROXY_IP/my/CSS/
  ProxyPass /my/grafik/ http://PROXY_IP/my/grafik/
  ProxyPass /my/javascript/ http://PROXY_IP/my/javascript/
  ProxyPass /my/site_manager/ http://PROXY_IP/my/site_manager/
  ProxyPass /my/StatiskeElementer/ http://PROXY_IP/my/StatiskeElementer/
  ProxyPass /my/Wgrafik/ http://PROXY_IP/my/Wgrafik/
  ProxyPass /my/wmlscript/ http://PROXY_IP/my/wmlscript/
  ProxyPass /my/Wstatisk/ http://PROXY_IP/my/Wstatisk/
  RedirectPermanent /roaming/ http://DOMAIN/my/servlet/my?U1=20711
  RedirectPermanent /roaming http://DOMAIN/my/servlet/my?U1=20711
  ProxyPass / http://PROXY_IP/my/site_manager/static_html/
</VirtualHost>

I have a "erhverv" directory under "PROXY_IP/my/site_manager/static_html/",
and if I do a "www.domain.dk/erhverv/" I get that directory just fine, but
if ommit the last "/" I get 404, and now the PR guys want to be able to use
"www.domain.dk/erhverv".

I'm no Apache guru and all my attampts has faild to work :( Could you guys
maybe help me out here, or at least give me some pointers.

As you can see, I have tried with mod_rewrite, but...


Med venlig hilsen/Best regards
Søren Neigaard
System Architect
................................
Mobilethink A/S
Arosgaarden
Åboulevarden 23, 5.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: s.neigaard@mobilethink.dk
Web: www.mobilethink.dk
................................


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Need help with /

Posted by Owen Boyle <ob...@bourse.ch>.
Søren Neigaard wrote:
> 
> I have a "erhverv" directory under "PROXY_IP/my/site_manager/static_html/",
> and if I do a "www.domain.dk/erhverv/" I get that directory just fine, but
> if ommit the last "/" I get 404, and now the PR guys want to be able to use
> "www.domain.dk/erhverv".

If you leave off the trailing slash, apache doesn't know whether you
want a file called "erhverv" in the docroot, or a subdirectory. So it
issues a redirect to http://www.domain.dk/erhverv/. But how does it get
the servername? It uses the ServerName directive - if that is missing
(as in your case) it uses the IP address hence the client gets the wrong
URL when the request following the redirect comes in. 

In other words:

Client: http://www.domain.dk/erhverv

Server: Sorry, don't have file like that, but I do have a directory.
I'll make you a redirect... Oh dear, no ServerName. Never mind, I'll use
the IP address. OK client, try http://192.168.1.1/erhverv/

Client: http://192.168.1.1/erhverv/

Server: Hmmm. No ServerName in this request - I'll just go to the first
VirtualHost then... Yikes! No file called erhverv! - oh well: 404....

Read the Docs about ServerName and UseCanonicalName to understand what's
going on.

Rgds,
Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Need help with /

Posted by Artiom Morozov <ar...@phreaker.net>.
i may be wrong, but it's a host on PROXY_IP that should be configured, 
if it refuses to accept directories names not followed with /...

if you still want to go with mod_rewrite, check loading order and afair 
you will need [P] option on RewriteRule

îÁ 2002.04.12 14:38 Søren Neigaard ÎÁÐÉÓÁÌ:
> Hi
> 
> I have the following VirtualHost:
> 
> <VirtualHost www.tdcmobil.dk>
> #  RewriteEngine on
> #  RewriteRule /erhverv$ /erhverv/
>   ProxyRequests Off
>   ProxyPass /my/CM/ http://PROXY_IP/my/CM/
>   ProxyPass /my/CMGrafik/ http://PROXY_IP/my/CMGrafik/
>   ProxyPass /my/CSS/ http://PROXY_IP/my/CSS/
>   ProxyPass /my/grafik/ http://PROXY_IP/my/grafik/
>   ProxyPass /my/javascript/ http://PROXY_IP/my/javascript/
>   ProxyPass /my/site_manager/ http://PROXY_IP/my/site_manager/
>   ProxyPass /my/StatiskeElementer/ 
> http://PROXY_IP/my/StatiskeElementer/
>   ProxyPass /my/Wgrafik/ http://PROXY_IP/my/Wgrafik/
>   ProxyPass /my/wmlscript/ http://PROXY_IP/my/wmlscript/
>   ProxyPass /my/Wstatisk/ http://PROXY_IP/my/Wstatisk/
>   RedirectPermanent /roaming/ http://DOMAIN/my/servlet/my?U1=20711
>   RedirectPermanent /roaming http://DOMAIN/my/servlet/my?U1=20711
>   ProxyPass / http://PROXY_IP/my/site_manager/static_html/
> </VirtualHost>
> 
> I have a "erhverv" directory under 
> "PROXY_IP/my/site_manager/static_html/",
> and if I do a "www.domain.dk/erhverv/" I get that directory just fine,
> but
> if ommit the last "/" I get 404, and now the PR guys want to be able
> to use
> "www.domain.dk/erhverv".
> 
> I'm no Apache guru and all my attampts has faild to work :( Could you
> guys
> maybe help me out here, or at least give me some pointers.
> 
> As you can see, I have tried with mod_rewrite, but...
> 
> 
> Med venlig hilsen/Best regards
> Søren Neigaard
> System Architect
> ................................
> Mobilethink A/S
> Arosgaarden
> Åboulevarden 23, 5.sal
> DK - 8000 Århus C
> Telefon: +45 86207800
> Direct: +45 86207810
> Fax: +45 86207801
> Email: s.neigaard@mobilethink.dk
> Web: www.mobilethink.dk
> ................................

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org