Ok so i searched the forum mod rewrite… htaccess redirect, htaccess block etc…
and i ended with this
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com(/)?.$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule / http://www.ANOTHER.com [R]
What i want to do…
Block and redirect all pages that i dont list at my mod rewrite, gonna keep adding like 10 domains that can see the page and all the other will get redirected to google for example.
What i think it does so far…
RewriteEngine On
- self explanatory
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com(/)?.*$ [NC]
- If the domain is equal to http://www.mydomain.com/*(anything else) or without the www or without the / at the end… END and display the site.
RewriteCond %{HTTP_REFERER} !^$
- If the domain is anything else… continue to next line…
RewriteRule /* http://www.ANOTHER.com [R]
- Redirect the domain to www.ANOTHER.com.
So am i correct or way wrong?
Thanks in advance.