MGCJerry
03-11-2002, 09:09 PM
I'm running Apache 1.2.3 on Windows2k pro and my htaccess file isnt working...
I did a search, but couldnt find a fix or a workaround.
I know I can write the "Error Document" statements into the httpd.conf file, but I want a couple folders to have a different error page (using htaccess). I also would like to prevent hotlinking from my site.
Any suggestions? I can post my httpd.conf file if you want to take a look at it.
Thanks in advance. :)
serve-you
03-11-2002, 11:39 PM
What are you putting in your .htaccess?
-Dan
MGCJerry
03-12-2002, 02:58 AM
Exactly out of my htaccess file:
ErrorDocument 401 /401.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.html
RewriteEngine on
RewriteBase /images
RewriteBase /OpenRPG/images
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://24.129.125.148:85/.*$ [NC]
RewriteRule ^.*\.gif$ - [F]
RewriteRule ^.*\.jpg$ - [F]
RewriteRule ^.*\.png$ - [F]
serve-you
03-12-2002, 03:16 AM
Do you actually have .htaccess enabled in the httpd.conf?
AccessFileName .htaccess
-Dan
MGCJerry
03-12-2002, 03:53 AM
Thanks serve-you...
umm.... looks like it...
<snip>
#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess
</snip>
Anything else I'm missing (most likely)?
Are there any other areas I need to modify, or is the .htaccess a *nix only thing..? Do you think If I re-named it, it would help cause I know windows dont like files with "no name"...
BRB... I'm gonig to try it.
Update! Renaming the file doesnt help either (yes I restarted Apache after the httpd.conf change)... I think I'm missing something somewhere... :bawling:
serve-you
03-12-2002, 03:56 AM
I'm totally guessing here. I haven't actually run apache on windoze in a couple of years.
-Dan
MGCJerry
03-12-2002, 04:04 AM
We must have cross posted or something...
I decided to attach my httpd.conf file... But I did delete the port, admin email, server address, etc in it...
MotleyFool
03-12-2002, 06:38 AM
You may need to change AllowOverride to All instead of None;
.htaccess is parsed only if Apache is allowed to override the default settings
Hope it helps
Cheers
Balaji
MGCJerry
03-12-2002, 07:48 AM
Thanks MotleyFool.
I did the necessary changes and it works now... I just *knew* I was missing something. :)
Thanks again.
I always thought .htaccess would work on Win machines... guess I have to alter my apache settings now...
thanks for that info
MGCJerry
03-12-2002, 03:22 PM
I thought the .htaccess was a *nix only thing. Now that I know it *does* work on windows, I laugh everytime I read a site about htaccess stating that it only works on *nix
serve-you
03-12-2002, 03:26 PM
doh!
I missed your reply last night. Sorry. Glad you got it sorted out anyway :)
-Dan
MGCJerry
03-12-2002, 05:14 PM
Usually when I work on a project or a problem, I got to get it done... I didnt go to bed till I sorted it out and tweaked the code... I got the code set up tp prevent hotlinking of my images... I finally went to bed at ~ 8 AM EST.
Thanks for everyones help...
:beer:
MotleyFool
03-13-2002, 02:50 AM
Jerry,
You are welcome.. :)
Glad you got it working.. but personally I just dont like Windows
Cheers
Balaji