Reputation: 11
I need to redirect every url that does not contain ?ref=something
, to a fixed html page.
Example:
Action: user navigates to www.domain.com/?ref=somerefcode. Result: stay on the page.
Action: user lands on www.domain.com without ref tag. Result: should be redirected to: www.domain.com/other_page
Thank you very much!
Ronen
Upvotes: 1
Views: 31
Reputation: 11
Thank you Sergio!
A little correction to fit my question exactly:
RewriteCond %{QUERY_STRING} ^ref=(.*)$
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} !^ref=(.*)$
RewriteRule ^(.*)$ /other_page [R,L]
Upvotes: 0
Reputation: 1922
You can use this rules:
RewriteCond %{QUERY_STRING} ^ref=(.*)$
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} !^/other_page$
RewriteRule ^(.*)$ /other_page [R,L]
Upvotes: 1