Im struggling with getting my URL rewriting rules working, basically I 
want to have certain URLS to redirect to a different host and I also want 
the inverse case (i.e. if the URL is NOT any of those URLs then redirect 
back to the original host).

So, the first case is for the two /create and /edit URLs:

  RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
  RewriteCond %{REQUEST_URI} ^/create$
  RewriteRule (.*) http://edit.example.com/create [L,R]

  RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
  RewriteCond %{REQUEST_URI} ^/edit/(.*)$
  RewriteRule (.*) http://edit.quamut.com/$1 [L,R]

Those work just fine.

Now, you would think the inverse of these rules would work to redirect 
back to the original host but they dont work (in fact, the next two rules 
break the first two rules - if I comment these out, the first two rules 
start working again):

  RewriteCond %{HTTP_HOST} ^edit\.example\.com [NC]
  RewriteCond %{REQUEST_URI} !^/create$
  RewriteRule (.*) http://www.example.com/$1 [R,L]
  
  RewriteCond %{HTTP_HOST} ^edit\.example\.com [NC]
  RewriteCond %{REQUEST_URI} !^/edit/(.*)$
  RewriteRule (.*) http://www.example.com/$1 [R,L]


Any ideas what am I missing here?


-- 
A


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to