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 anyone? (https://gfy.com/showthread.php?t=187695)

Oracle Porn 10-19-2003 07:00 AM

htaccess help anyone?
 
I want to redirect all domains with the suffix .ru
how can I do that?

pornanza 10-19-2003 07:36 AM

you probably could do it with .htaccess, but i'm not feeling too clever today.

PHP version for you:

PHP Code:


<?php

 
if (eregi('\.ru$'gethostbyname($_SERVER['REMOTE_ADDR']))) {
  
header('Location: redirect.html');
  exit;
 }

?>

ryan
http://pornanza.net

Oracle Porn 10-19-2003 07:45 AM

i know 0 about php or any other language other than html...
where do I put this php file? in my main root?

pornanza 10-19-2003 08:27 AM

yeah

paste the code below into index.php in the root

PHP Code:


<?php

 
if (eregi('.ru$'gethostbyname($_SERVER['REMOTE_ADDR']))) {
  
header('Location: redirect.html');
  exit;
 }

?>

you can paste your normal HTML after ?>

ryan
http://pornanza.net

icedemon 10-19-2003 09:07 AM

RewriteEngine On
RewriteCond %{HTTP_REFERER} .*?\.ru.* [NC]
RewriteRule /(.*) http://someothersite.com [R,L]

I didn't test it, so let me know if it doesn't work. I also didn't know if you mean redirect referers or your own domains. If it's your own domains, change HTTP_REFERER to HTTP_HOST

Oracle Porn 10-19-2003 03:06 PM

Quote:

Originally posted by icedemon
RewriteEngine On
RewriteCond %{HTTP_REFERER} .*?\.ru.* [NC]
RewriteRule /(.*) http://someothersite.com [R,L]

I didn't test it, so let me know if it doesn't work. I also didn't know if you mean redirect referers or your own domains. If it's your own domains, change HTTP_REFERER to HTTP_HOST

gives me 500 error

icedemon 10-19-2003 03:35 PM

I tested it this time on my server. It's at http://paywide.com should redirect all .ru to yahoo.com. Here is what's in the .htaccess

RewriteEngine On
RewriteCond %{HTTP_REFERER} .*?.ru.* [NC]
RewriteRule .* http://www.yahoo.com [R,L]

If it still give you a 500 error, check your error logs for apache on your account to see what it says. If you don't have access to your error logs, check with your hosting company (if you don't have your own server) to make sure you can use .htaccess files and also (this is the most important) make sure you can use ModRewrite in you .htaccess file. If you can use .htaccess or ModRewrite, just give the above code to the server admin to put it in httpd.conf for your account.


All times are GMT -7. The time now is 06:36 AM.

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