Re: quesiton for Apache url rewrite module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2008-11-26 at 09:56 -0800, caesarkim wrote:
> Yes. I want the latter.
> 
> 
> 
> Tom Evans-3 wrote:
> > 
> > On Wed, 2008-11-26 at 08:49 -0800, caesarkim wrote:
> >> I am trying to use url rewrite module, but i am not familar with it.
> >> 
> >> I want to rewrite any request (http://localhost/clusterjsp/*.jsp) to be
> >> http://localhost/*.jsp. 
> >> 
> >> Can anybody tell me how to do this?
> >> 
> >> Thanks.
> >> 
> >> 
> > 
> > To clarify, do you want users to go to
> > http://localhost/clusterjsp/foo.jsp and be served the page
> > http://localhost/foo.jsp or do you want users to go to
> > http://localhost/foo.jsp and be served the page
> > http://localhost/clusterjsp/foo.jsp ? You asked for the former, but I
> > think you actually wanted the latter.
> > 
> > Cheers
> > 
> > Tom
> > 

RewriteCond %{REQUEST_URI} ^/[^\/\.]*\.jsp       # is the url like /foo.jsp
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f  # if that file doesnt exist
RewriteRule ^/(.*\.jsp) /clusterjsp/$1 [L]       # redirect to /clusterjsp/foo.jsp          

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux