rewrite URLs that don't start with a certain pattern

This is a discussion on rewrite URLs that don't start with a certain pattern within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, After some steps with the rewrite engine I am stuck. I want to redirect every URL that does _not_ ...


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 03-25-2006
Adolf Schwarz
 
Posts: n/a
Default rewrite URLs that don't start with a certain pattern

Hi,

After some steps with the rewrite engine I am stuck.

I want to redirect every URL that does _not_ start with some pattern to
another URL. But how do I write the condition for _not_ matching a pattern?

For Example:

www.myserver.net/blah -> www.myserver.net/subdir/
www.myserver.net/ -> www.myserver.net/subdir/
www.myserver.net/foo -> www.myserver.net/subdir/
www.myserver.net/subdir/ -> no rewrite
www.myserver.net/subdir/foo -> no rewrite

I am no regex expert, but after consulting some regex manuals I still
cannot figure it out.

Thanks,

-Adi Schwarz
  #2 (permalink)  
Old 03-25-2006
Adolf Schwarz
 
Posts: n/a
Default Re: rewrite URLs that don't start with a certain pattern

Adolf Schwarz wrote:
> Hi,
>
> After some steps with the rewrite engine I am stuck.
>
> I want to redirect every URL that does _not_ start with some pattern to
> another URL. But how do I write the condition for _not_ matching a pattern?


Sorry, just found out

"!pattern" does it.

-as
 


Thread Tools
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

vB 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 06:08 AM.


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