Home » Htaccess Tools » Questions regarding htaccess » conflicting order... asking to much of htaccess... or just me beign dumb?
conflicting order... asking to much of htaccess... or just me beign dumb? [message #860] Sun, 27 January 2008 12:12 Go to next message
RogerRogerson  is currently offline RogerRogerson
Messages: 8
Registered: January 2008
Please help.

I think I may be trying to do too much, and it seems the htaccess file only works periodically?

::Goals::
I would like to...
Prevent access to htaccess file.
Prevent access to two other files types (.aa/.bbb).
Prevent Dir. browsing.
Prevent Dir. listing.
Canocalize several Domains/TLDs.
Remove "index.php" from the URL.
Include HotLink Protection (serve 403).


Yet as sson as I start getting anything major going on, I either get problems when testing (pages won't load, images won't load etc.), or it jsut doesn't seem to do anything.
The realyl confusing part is that it appears to work for some time... then stuffs up for a while ... and loops that process.


Below is a sample of what I currently have...

# Prevent access to the .htaccess file
<Files .htaccess|.aa|.bb>
order allow,deny
deny from all
</Files>


# Prevent Dir. Browsing
# Prevent Dir. Listing
Options All -Indexes
IndexIgnore *


# Enable following of Redirects/ReWrites etc.
# Enable ReWrites
Options +Indexes +FollowSymlinks
RewriteEngine on


# Remove index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+) index.php/$1 [L]


# Canonicalise all DNs/TLDs to last DN/TLD
RewriteCond %{HTTP_HOST} ^domain1\.co.uk [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?domain3\.co.uk [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?domain4\.com [NC]
RewriteRule (.*) http://www.domain1.co.uk/$1 [R=301]


# HotLink Protection
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain1\.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain2\.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain3\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain4\.com/.*$ [NC]
RewriteRule .*\.(bmp|gif|jpe?g|png|tiff|swf|mpe?g|avi|mov|txt|doc|xls|pp t|exe|zip|rar|tar)$ [R,NC]


Please tell me what it is I'm doing wrong.
It wouldn't be too bad, bar the fact that i stops/starts workign, for no apparent reason.
Re: conflicting order... asking to much of htaccess... or just me beign dumb? [message #868 is a reply to message #860 ] Mon, 28 January 2008 22:59 Go to previous messageGo to next message
RogerRogerson  is currently offline RogerRogerson
Messages: 8
Registered: January 2008
Okay... I've tried tweaking it... and it appeared to work fine.
Cleared the vach, used different browsers... was fine in every way.

Got up this morning, checked out my clietns site, and No Images, at all!

So please, what the hell is wrong with the htaccess details above?
Why does it work for a while, then start blocking images to the domain it is on?
Re: conflicting order... asking to much of htaccess... or just me beign dumb? [message #878 is a reply to message #860 ] Sun, 03 February 2008 14:34 Go to previous message
RogerRogerson  is currently offline RogerRogerson
Messages: 8
Registered: January 2008
Okay - I'm goign to assume that no one actually uses this forum any more... as though questions seem to get asked - people don't seem to reply.
Previous Topic:Htaccess problems. Entire site asking for password
Next Topic:different querystrings redirect to different urls
Goto Forum:
  


Current Time: Sat May 17 01:47:09 CEST 2008

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software