Redirect If Domain Name Contains x ?

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
Turtles
-


Joined: 03 Aug 2010
Posts: 44

PostPosted: Fri Jun 20, 2014 7:20 am    Post subject: Redirect If Domain Name Contains x ? Reply with quote

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 View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Jun 20, 2014 5:34 pm    Post subject: Re: Redirect If Domain Name Contains x ? Reply with quote

[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 View user's profile Send private message
Turtles
-


Joined: 03 Aug 2010
Posts: 44

PostPosted: Tue Jul 15, 2014 6:55 am    Post subject: Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group