PDA

View Full Version : htaccess not working properly


maidos
28 Jul 2008, 14:35
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
28 Jul 2008, 14:44
Did you restart/reload apache after you added the htaccess file (sometimes you need to do that).

maidos
28 Jul 2008, 14:59
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
29 Jul 2008, 07:42
Please post your whole .htaccess file.

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

maidos
29 Jul 2008, 11:45
No, there are no other htaccess files. Onlyhave one.

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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

SEOvB
29 Jul 2008, 14:23
You can start by removing the last two

RewriteEngine on

You only need it once at the start of the file

maidos
29 Jul 2008, 14:59
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....