Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For some reason I am not able to make the following directive work on my apache. Any help would be much appreciated.

<Location "/(login.php|register.php)">
 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Location>

However following works:

<Location "/login.php">
     RewriteEngine On
     RewriteCond %{HTTPS} off
     RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Location>
share|improve this question

migrated from stackoverflow.com Oct 5 '12 at 17:02

This question came from our site for professional and enthusiast programmers.

1 Answer 1

If you're going to use a regular expression, you need LocationMatch instead:

http://httpd.apache.org/docs/2.2/mod/core.html#locationmatch

EDIT: should be on ServerFault

share|improve this answer
    
Thanks, that did the trick. –  user1720604 Oct 4 '12 at 18:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.