GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   htaccess help.... (https://gfy.com/showthread.php?t=975844)

klinton 06-30-2010 10:18 AM

htaccess help....
 
I would like to setup redirection via htaccess...redirecting by referer and browser language together....only when surfer is refered by some site and his browser is in some language..then he would be redirected...

for example.... referer is aaa.com and language is ru ..... so how would htaccess line look like ?

thanks.....

Kiopa_Matt 06-30-2010 10:56 AM

Your best bet is using PHP.

Then GeoIP the addresses using maxmind . com. Free version available.

klinton 06-30-2010 11:00 AM

no possibility to do it in htaccess ?

Kiopa_Matt 06-30-2010 11:01 AM

Not that I know of, nope. Maybe look into mod_rewrite, but I doubt it.

klinton 06-30-2010 11:40 AM

well the problem is that i know those 2 rules in htaccess, don't know how to make one rule of them :)

RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?aaa.com(/)?.*$ [NC]
RewriteRule .* link_to_redirect [R]

this was by referer...


RewriteCond %{HTTP:Accept-Language} (ru) [NC]
RewriteRule .* redirect_to [L]

and this was by language........

klinton 06-30-2010 01:10 PM

bump..........

fris 06-30-2010 01:18 PM

why do you wanna do both? usally its just 1, or is it for only 1 domain?

and if its 1 domain, why not redirect it without the language since its going to be the same domain all the time.

Tom_PM 06-30-2010 01:23 PM

In mod rewrites, the AND is implicit I thought. Did you try simply placing both rewrite conditions before the rewrite rule?

fris 06-30-2010 01:37 PM

Here is what you want if you want to do both

Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(.*\.)?google\.com/ [NC]
RewriteCond %{HTTP:Accept-Language} (ru) [NC]
RewriteRule .* http://www.google.ru [R,L]

will redirect if the refer is google and the language is russian, and will redirect to russian version of google (both have to be true or it wont redirect)

hope this helps

klinton 06-30-2010 01:50 PM

thank you very much, will try it....


All times are GMT -7. The time now is 11:40 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123