I´m trying to redirect with rewrite rules in Apache .htaccess. I want to redirect 360invest.pl to 360investment.pl.
But I want one more address on the server which I do NOT want to be redirected. If somebody tries 360invest.pl/bezrzecze it should not redirect to 360investment.pl.
I used this code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^360invest.pl/bezrzecze$ [NC]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [OR,NC]
RewriteCond %{HTTP_HOST} ^360invest.pl$ [NC]
RewriteRule ^ http://www.360investment.pl%{REQUEST_URI} [L,R=301]
This works only if you try www.360invest.pl/bezrzecze. It doesn't work if you try http://360invest.pl/bezrzecze.
In addition if you click any link on the website (www.360invest.pl/bezrzecze) it will redirect you to www.360investment.pl - it should not.
I'm not sure what I'm missing here. Thank you for your help.