| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Turtles -
 
  Joined: 03 Aug 2010 Posts: 44
 
  | 
		
			
				 Posted: Fri Jun 20, 2014 7:20 am    Post subject: Redirect If Domain Name Contains x ? | 
				      | 
			 
			
				
  | 
			 
			
				I'm trying to redirect visitors who visit my website from any domain that contain certain keywords.
 
 
I used the TrustAbyss rewriter and it came up with a rule, but the rule doesn't work.  Here's what i have:
 
 
 	  | Code: | 	 		  
 
Virtual Path Regular Expression: /*$
 
 
Case Sensitive: Not Checked
 
 
Conditions:
 
HTTP Header: Referer (HTTP_REFERER)
 
Matches with
 
word1|word2|word3$
 
 
Apply to subrequests too: Checked
 
 
If this rule matches: Perform an external redirection
 
 
Redirect to: http://www.somethingelse.com
 
 
Append Query String: Not Checked
 
 
Escape Redirection Location: Checked
 
 
Status Code: 301 - Moved Permanently
 
 | 	  
 
 
Any idea how i can get this working? | 
			 
		  | 
	
	
		| Back to top | 
		
			          | 
		
	
	
		  | 
	
	
		admin Site Admin
 
  Joined: 03 Mar 2002 Posts: 1348
 
  | 
		
			
				 Posted: Fri Jun 20, 2014 5:34 pm    Post subject: Re: Redirect If Domain Name Contains x ? | 
				      | 
			 
			
				
  | 
			 
			
				[code]
 
Conditions:
 
HTTP Header: Referer (HTTP_REFERER)
 
Matches with
 
word1|word2|word3$
 
[/quote]
 
 
The regular expression here means a referer which contains word1 or word2 or ends with word3.
 
 
We strongly suggest that you turn on URL rewriting debugging to understand how your rules are acting. But we suspect that the rule is not actually matching with the right regular expression. May be you'll have to rewrite it or change it a bit. _________________ Follow @abyssws on Twitter
 
Subscribe to our newsletter
 
_________________
 
Forum Administrator
 
Aprelium - https://aprelium.com | 
			 
		  | 
	
	
		| Back to top | 
		
			          | 
		
	
	
		  | 
	
	
		Turtles -
 
  Joined: 03 Aug 2010 Posts: 44
 
  | 
		
			
				 Posted: Tue Jul 15, 2014 6:55 am    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				I removed the ending $ and it fixed it.  Except now im faced with another problem.
 
 
What's currently happening is if one of the words in the the thread title (on my forum) contain one of the words in the rewrite rule, then that thread is getting redirected to the domain.  I need it to only match the domain name and not anything that comes after the domain name (so it should match something.something only).  Any idea how i can do this? | 
			 
		  | 
	
	
		| Back to top | 
		
			          | 
		
	
	
		  | 
	
	
		 |