Forum Moderators: phranque

Message Too Old, No Replies

need help [htaccess]

         

netzoner

7:48 am on Jul 26, 2005 (gmt 0)

10+ Year Member



hi
im new to this i have my website and im doing fine in managing it but i need help with htaccess

i have pages in sub domain pointing to files in the my domain and i have mad several htaccess to allow my sub domains to download but with no success

i want htaccess file to alow my sub domains to download the file and deny any other domain from downloading

your help in this matter is extremely appreciated

jdMorgan

8:31 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



netzoner,

Welcome to WebmasterWorld!

Please post your code so we can discuss it.

I suspect you're trying to implement access control based on HTTP_REFERER. I should warn you that this method is unreliable at best. A cookies-based access control system is a much better approach, if you're comfortable with the methods needed to implement it.

Jim

netzoner

5:59 am on Jul 27, 2005 (gmt 0)

10+ Year Member



this is the code

[code]
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?dev.example.com(/)?.*$ [NC]
RewriteRule .*\.(gif¦jpg¦jpeg¦bmp¦exe¦zip¦rar¦ace)$ http://example.com/vb [R,NC]
[code/]

A cookies-based access control system is a much better approach

can you tell me more about this methode and if its better thin htaccess i want to use it

[edited by: jatar_k at 6:47 pm (utc) on July 27, 2005]
[edit reason] examplified url [/edit]

jdMorgan

1:06 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This related recent thread [webmasterworld.com] contains an outline of the steps you'll need to take.

Jim