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.

I have example.com and example.org using presenting different content using the same cms. However I want the administrators to only login through example.com. I found these rules on the stackexchange sites but the second one (make sure administration is only accessed on .com) does not work.

RewriteEngine On
#this rule works
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

#this rule does not
RewriteCond %{HTTP_HOST} ^(www\.)?example\.org$
RewriteRule ^/administrator(/.*)?$ http://example.com/administrator$1 [R=301,L]

What am i missing?

share|improve this question
    
Looks good to me, too –  PP. Oct 11 '10 at 7:32
    
if i go to example.org/administrator I stay on it, no 301 Redirect –  Moak Oct 11 '10 at 7:34
    
If you go to example.org/administrator/ does it work? (i.e. is this a trailing slash problem) –  PP. Oct 11 '10 at 7:42
    
@PP: nope, just sits on example.org, I know the rewrite engine is one because the first rule definitely works –  Moak Oct 11 '10 at 13:26
    
Maybe the [NC] is required for the second RewriteCond (sorry just stabbing in the dark) –  PP. Oct 12 '10 at 7:33
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.