PDA

View Full Version : htaccess not working properly


maidos
07-28-2008, 01:35 PM
I did post on wht but no one replied.

I have one htaccess on the public_html directory and i have this anti hotlinking code. But for some reason this doesnt work while it works on other servers. I have reinstalled mod_rewrite but still the same issue. Please help

#RewriteEngine on
#RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{HTTP_REFERER} !^http://(www\.)?site\.net/ [NC]
#RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://site.net/no_hotlinking.gif [NC]

Lynne
07-28-2008, 01:44 PM
Did you restart/reload apache after you added the htaccess file (sometimes you need to do that).

maidos
07-28-2008, 01:59 PM
Yes, I did restart but still the same

--------------- Added 1217268947 at 1217268947 ---------------

Also checked AllowOverride which is set to All in the apache conf.

Dismounted
07-29-2008, 06:42 AM
Please post your whole .htaccess file.

Marco van Herwaarden
07-29-2008, 06:53 AM
Also are there any .htacces files in a sub-directory?

maidos
07-29-2008, 10:45 AM
No, there are no other htaccess files. Onlyhave one.

Also made sure that my server dont have phpsuexec installed and apache can read files

RewriteEngine On

RewriteRule ^(.*)t([0-9]+)(.*)newpost(.*)$ showthread.php?t=$2&goto=newpost [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)/post([0-9]+)(.*)$ showpost.php?p=$6 [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)/([a-z]+)([0-9]+)(.*)$ showthread.php?t=$4&page=$7 [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)$ showthread.php?t=$4 [QSA,L]
RewriteRule ^(.*)f([0-9]+)/([a-z]+)([0-9]+)(.*)$ forumdisplay.php?f=$2&page=$4 [QSA,L]
RewriteRule ^(.*)f([0-9]+)(.*)$ forumdisplay.php?f=$2 [QSA,L]


RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} http://k-max\.co.jp [NC]
RewriteRule .* - [F]

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site.net(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://asite.net/no_hotlinking.html [R,NC]


php_value upload_max_filesize 1000M
php_value post_max_size 1000M
php_value memory_limit 900M
php_value max_execution_time 0
php_value max_input_time 0




<Files *>
order deny,allow
deny from 68.237.0.146
deny from 70.18.27.242
deny from 121.108.111
deny from 165.21.155.9
deny from 118.105.225.193
deny from 78.53.35
deny from 75.152.101.216
deny from 166.114.87.10
deny from 68.3.156.250
deny from 203.184.45
deny from 83.252.216.81
deny from 75.177.161
deny from 76.88.36
deny from 69.226.248
deny from 60.2.55
deny from 76.126.169
deny from 76.105.4
deny from 124.13.223
deny from 84.79.105
deny from 70.231.252
deny from 71.160.62
deny from 75.36.135
deny from 68.101.127
deny from 76.102.26
deny from 96.229.54
deny from 67.164.73
deny from 76.171.8
deny from 193.40.10
deny from 65.78.131
deny from 76.20.1
deny from 69.231.227
deny from 69.107.76
deny from 172.165.58
deny from 69.224.36
deny from 76.87.118
deny from 69.111.73
deny from 71.193.185.215
deny from 161.53.232.46
deny from 66.199.251.90
deny from 217.123.72.20
deny from 64.86.220.80
deny from 87.118.109.237
deny from 76.221.202.229
deny from 75.61.82.77
deny from 71.193.185.0
deny from 71.193.185.255
deny from 76.221.200.0
deny from 76.221.200.255
deny from 71.193.185.
deny from 76.221.200
deny from 75.61.82
deny from 76.221.202
deny from 75.61.82
deny from 80.67.221
deny from 69.106.6
deny from 69.224.112
deny from 69.224.51
deny from 69.106.7
deny from 69.227.27
deny from 69.227.24
deny from 118.137.35
deny from 66.172.60
deny from 66.177.58
deny from 66.180.205
deny from 209.204.61
deny from 216.151.155
deny from 76.193.116
deny from 70.124.94
deny from 218.186.12
deny from 69.139.153
deny from 124.82.233
deny from 60.49.105
deny from 60.52.72
deny from 60.52.73
deny from 60.53.43
deny from 60.50.255
deny from 218.186.8
deny from 155.69.12
deny from 125.38.30
deny from 66.218.47
deny from 62.29.0.0/17
deny from 62.68.192.0/19
deny from 62.85.128.0/19
deny from 62.108.64.0/19
deny from 62.113.0.0/19
deny from 62.201.192.0/18
deny from 62.244.192.0/18
deny from 62.248.0.0/17
deny from 77.67.128.0/17
deny from 77.72.184.0/21
deny from 77.73.216.0/21
deny from 77.75.32.0/21
deny from 77.75.216.0/21
deny from 77.79.64.0/18
deny from 77.92.0.0/19
deny from 77.92.96.0/19
deny from 77.92.128.0/19
deny from 77.223.128.0/19
deny from 77.245.144.0/20
deny from 78.135.0.0/17
deny from 78.160.0.0/11
deny from 80.71.128.0/20
deny from 80.87.48.0/20
deny from 80.93.208.0/20
deny from 80.245.80.0/20
deny from 80.251.0.0/20
deny from 80.251.32.0/20
deny from 81.6.64.0/18
deny from 81.8.0.0/17
deny from 81.21.160.0/20
deny from 81.22.96.0/20
deny from 81.91.16.0/20
deny from 81.91.112.0/20
deny from 81.212.0.0/14
deny from 82.145.224.0/19
deny from 82.151.128.0/19
deny from 82.222.0.0/16
deny from 83.66.0.0/16
deny from 84.17.64.0/19
deny from 84.44.0.0/17
deny from 84.51.0.0/18
deny from 85.29.0.0/18
deny from 85.96.0.0/12
deny from 85.119.32.0/21
deny from 85.119.64.0/21
deny from 85.153.0.0/16
deny from 85.158.96.0/21
deny from 85.159.64.0/21
deny from 85.159.72.0/21
deny from 85.235.64.0/19
deny from 86.108.128.0/17
deny from 87.236.96.0/21
deny from 87.251.0.0/19
deny from 88.151.232.0/21
deny from 88.224.0.0/11
deny from 89.19.0.0/19
deny from 89.106.0.0/19
deny from 89.252.128.0/18
deny from 90.158.0.0/15
deny from 91.93.0.0/16
deny from 91.102.160.0/21
deny from 91.151.80.0/20
deny from 91.188.192.0/18
deny from 91.191.160.0/20
deny from 193.0.61.0/24
deny from 193.23.156.0/24
deny from 193.25.124.0/23
deny from 193.34.132.0/23
deny from 193.36.0.0/24
deny from 193.36.184.0/24
deny from 193.37.135.0/24
deny from 193.37.154.0/24
deny from 193.41.2.0/23
deny from 193.42.216.0/24
deny from 193.58.236.0/24
deny from 193.108.213.0/24
deny from 193.110.170.0/23
deny from 193.110.208.0/21
deny from 193.138.30.0/24
deny from 193.140.0.0/16
deny from 193.143.226.0/24
deny from 193.150.165.0/24
deny from 193.164.9.0/24
deny from 193.188.198.0/23
deny from 193.189.142.0/24
deny from 193.192.96.0/19
deny from 193.200.134.0/24
deny from 193.200.170.0/24
deny from 193.200.180.0/24
deny from 193.200.188.0/24
deny from 193.201.128.0/22
deny from 193.201.149.192/26
deny from 193.201.157.0/25
deny from 193.202.18.0/24
deny from 193.202.120.0/24
deny from 193.218.113.0/24
deny from 193.218.200.0/24
deny from 193.223.76.0/24
deny from 193.243.192.0/19
deny from 193.254.228.0/23
deny from 193.254.252.0/23
deny from 193.255.0.0/16
deny from 194.0.130.0/24
deny from 194.0.142.0/24
deny from 194.0.178.0/24
deny from 194.0.202.0/24
deny from 194.9.174.0/24
deny from 194.24.168.0/23
deny from 194.24.224.0/23
deny from 194.27.0.0/16
deny from 194.29.208.0/21
deny from 194.36.160.0/24
deny from 194.50.84.0/24
deny from 194.50.179.0/24
deny from 194.54.32.0/19
deny from 194.60.73.0/24
deny from 194.69.206.0/24
deny from 194.110.150.0/24
deny from 194.110.213.0/24
deny from 194.125.232.0/22
deny from 194.126.230.0/24
deny from 194.140.227.0/24
deny from 194.169.253.0/24
deny from 194.242.32.0/24
deny from 195.8.109.0/24
deny from 195.14.19.0/24
deny from 195.33.192.0/18
deny from 195.39.224.0/23
deny from 195.46.128.0/19
deny from 195.49.216.0/21
deny from 195.85.242.0/24
deny from 195.85.255.0/24
deny from 195.87.0.0/16
deny from 195.95.149.0/24
deny from 195.95.160.0/24
deny from 195.95.179.0/24
deny from 195.112.128.0/19
deny from 195.114.108.0/23
deny from 195.128.32.0/21
deny from 195.128.254.0/23
deny from 195.137.222.0/23
deny from 195.138.222.0/24
deny from 195.140.196.0/22
deny from 195.142.0.0/16
deny from 195.149.85.0/24
deny from 195.149.116.0/24
deny from 195.155.0.0/16
deny from 195.174.0.0/16
deny from 195.175.0.0/16
deny from 195.177.206.0/23
deny from 195.177.230.0/23
deny from 195.182.25.0/24
deny from 195.200.222.0/24
deny from 195.214.128.0/18
deny from 195.234.52.0/24
deny from 195.234.165.0/24
deny from 195.242.122.0/23
deny from 195.244.32.0/19
deny from 195.245.227.0/24
deny from 212.2.192.0/19
deny from 212.12.128.0/19
deny from 212.15.0.0/19
deny from 212.29.64.0/18
deny from 212.31.0.0/19
deny from 212.48.224.0/19
deny from 212.50.32.0/19
deny from 212.57.0.0/19
deny from 212.58.0.0/19
deny from 212.64.192.0/19
deny from 212.65.128.0/19
deny from 212.79.96.0/19
deny from 212.98.0.0/19
deny from 212.98.192.0/18
deny from 212.101.96.0/19
deny from 212.108.128.0/19
deny from 212.109.96.0/19
deny from 212.109.224.0/19
deny from 212.115.0.0/19
deny from 212.125.0.0/19
deny from 212.127.96.0/19
deny from 212.133.128.0/17
deny from 212.146.128.0/17
deny from 212.154.0.0/17
deny from 212.156.0.0/16
deny from 212.174.0.0/16
deny from 212.175.0.0/16
deny from 212.252.0.0/16
deny from 212.253.0.0/16
deny from 213.14.0.0/16
deny from 213.43.0.0/16
deny from 213.74.0.0/16
deny from 213.138.0.0/19
deny from 213.139.192.0/19
deny from 213.139.224.0/19
deny from 213.143.224.0/19
deny from 213.144.96.0/19
deny from 213.148.64.0/19
deny from 213.153.128.0/19
deny from 213.153.160.0/19
deny from 213.153.192.0/18
deny from 213.155.96.0/19
deny from 213.159.32.0/19
deny from 213.161.128.0/19
deny from 213.186.128.0/19
deny from 213.194.64.0/18
deny from 213.202.0.0/19
deny from 213.204.64.0/18
deny from 213.232.0.0/18
deny from 213.236.32.0/19
deny from 213.238.128.0/18
deny from 213.243.0.0/19
deny from 213.243.32.0/19
deny from 213.248.128.0/18
deny from 213.254.128.0/19
deny from 217.17.144.0/20
deny from 217.31.224.0/20
deny from 217.31.240.0/20
deny from 217.64.144.0/20
deny from 217.64.208.0/20
deny from 217.68.208.0/20
deny from 217.131.0.0/16
deny from 217.169.192.0/20
deny from 217.174.32.0/20
deny from 217.195.192.0/20
</Files>

SEOvB
07-29-2008, 01:23 PM
You can start by removing the last two

RewriteEngine on

You only need it once at the start of the file

maidos
07-29-2008, 01:59 PM
Well it works now however the sysadmin who did this wrote this

Hi,

I have commented it, it is incorrect to add that. For the .htaccess, we really
can't tell how it worked, as we have tried several ways, and maybe one of them,
but really not sure, possibly the permissions as we also changed it, restarted
apache, changes some config and tests....