I need to redirect this:
http://domain.com/anotherdomain.com
to
http://domain.com/subfolder/?website=anotherdomain.com
The URL anotherdomain.com
will be dynamic. It should only detect domains entered after the root domain and not other subfolders. Ex:
SHOULD REDIRECT
domain.com/anotherdomain.com
SHOULDN'T REDIRECT
domain.com/internet-marketing-services/search-engine-optimization-services/
What I've tried:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(/|index.php)?$ /link-building-services/?website=%1 [R=301,L]
</IfModule>