Reputation: 9230
We're stuck on a problem regarding .htaccess. We need the website to redirect to another domain, except if the user wants the /intranet uri. Then it should just go on to index.php.
We tried the following but it's redirecting both:
RewriteEngine On
RewriteCond %{REQUEST_URI} /intranet
RewriteRule .* index.php [L]
RewriteRule .* http://google.be
We also tried this
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/intranet
RewriteRule .* http://google.be
RewriteRule .* index.php [L]
But without results. How can I proceed?
Upvotes: 1
Views: 94
Reputation: 786339
Problem is use of REQUEST_URI
variable that changes it's value to index.php
in last rule. You need to use THE_REQUEST
variable that doesn't get updated.
Use this code:
RewriteEngine On
RewriteCond %{THE_REQUEST} !/intranet [NC]
RewriteRule ^ http://google.be [L,R]
RewriteRule ^ index.php [L]
Upvotes: 2