Reputation: 5954
Is there any way to permanently redirect a domain to another domain with a corresponding parameter?
For example, somebody visits example.com
, which permanently redirects to eg.com/?url=example
.
I've tried RewriteRule ^/?$ "https\:\/\/eg\.com\/?url=example" [R=301,L]
, and, although it does indeed redirect to eg.com
, it obviously ignores the parameters.
Is there any way to do this with htaccess
?
Upvotes: 0
Views: 532
Reputation: 1405
Escape backslash before question mark.
RewriteRule ^/?$ "https\:\/\/eg\.com\/\?url=example" [R=301,L]
# ^ add backslash here
Upvotes: 1