Re: Redirecting to Tomcat

This is a discussion on Re: Redirecting to Tomcat within the Apache Web Server forums, part of the Web Server and Related Forums category; Per Johansson wrote: > Can I make redirection work on the top > level URI and selected URI:s only? ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-08-2006
Robert Ionescu
 
Posts: n/a
Default Re: Redirecting to Tomcat

Per Johansson wrote:
> Can I make redirection work on the top
> level URI and selected URI:s only?


Use RedirectMatch instead:

RedirectMatch 301 ^/$ http://www.dot.com:8080/JSPApplication/

--
Robert
  #2 (permalink)  
Old 05-08-2006
Stephen Kay
 
Posts: n/a
Default What is the syntax to exclude a URL from RewriteRule?

I'm using the following to direct every page ending in .html through a php
function:

RewriteRule ^(.*)\.html$ /dopage.php?p=$1.html [L]

I have a UNIX admin page that I *don't* want to get treated by this. How
would I modify this to exclude that one page? I assume by using RewriteCond,
but I'm not sure of the syntax.

The URL to exclude would be www.example.com/admin/index.html

Thanks,
--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^


  #3 (permalink)  
Old 05-08-2006
Robert Ionescu
 
Posts: n/a
Default Re: What is the syntax to exclude a URL from RewriteRule?

Stephen Kay wrote:
> I assume by using RewriteCond


Exactly. One which checks the value of REQUEST_URI:

# note: the following is not a RegEx
RewriteCond %{REQUEST_URI} !=/admin/index.html
RewriteRule ^(.*)\.html$ /dopage.php?p=$1.html [L]

--
Robert
  #4 (permalink)  
Old 05-09-2006
Stephen Kay
 
Posts: n/a
Default Re: What is the syntax to exclude a URL from RewriteRule?

in article e3oepu$nct$1@online.de, Robert Ionescu at
robsiegen@googlemail.com wrote on 5/8/06 5:56 PM:

> Stephen Kay wrote:
>> I assume by using RewriteCond

>
> Exactly. One which checks the value of REQUEST_URI:
>
> # note: the following is not a RegEx
> RewriteCond %{REQUEST_URI} !=/admin/index.html
> RewriteRule ^(.*)\.html$ /dopage.php?p=$1.html [L]


Thanks! But it appears it was not as simple as I originally anticipated. :(

How would you do the above, but exclude *any* page in the /admin folder?

Thanks much,
--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^


  #5 (permalink)  
Old 05-09-2006
Robert Ionescu
 
Posts: n/a
Default Re: What is the syntax to exclude a URL from RewriteRule?

Stephen Kay wrote:
> How would you do the above, but exclude *any* page in the /admin folder?


This time you must use a RegEx here:

RewriteCond %{REQUEST_URI} !^/admin/

--
Robert
 
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 01:39 AM.


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