negate a regex
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > negate a regex




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

    negate a regex  
maxim2k


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


 
01-18-06 10:52 PM

Hi all,

I have a web site with a directory that needs to be accessed only over
HTTPS, HTTP access shouldn't be allowed to that directory for security
reasons.

The rest of the web site needs to be accessed only over HTTP, HTTPS
access shouldn't be allowed to the rest of the web site for
performance reasons.

The document root between the HTTP and HTTPS Apache virtual hosts is shared.

I have the following directive in my Apache HTTP vhost config file to
make sure that if anyone tries to access the secure directory over
HTTP, he is redirected to the HTTPS URL:

RedirectPermanent  ^/secureDirectory/
https://www.mywebsite.com/secureDirectory/

This directive works just fine.

Now I need a directive for the Apache HTTPS vhost  config file to make
sure that if anyone tries to access the rest of the web site (anything
outside the secure directory) over HTTPS, he is redirected to the HTTP
URL, something like this:

RedirectPermanent  !^/secureDirectory/ http://www.mywebsite.com/

Obviously this directive doesn't work, since that's not the right way
to negate a regular expression.
How do I negate it?

Do you have a better solution for this?

Thanks.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:08 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