Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


Pages in this thread: 1 | [2] | (show all)   Print Thread
Standard User trolleybus
(regular) Fri 16-Nov-12 22:51:22
Print Post

Re: .htaccess file


[re: camieabz] [link to this post]
 
In reply to a post by camieabz:
Suggest you google for .htaccess comments. A hash symbol should work.


Found http://perishablepress.com/stupid-htaccess-tricks/ and indeed # precedes a comment on a line by line basis.

I note this statement in that URL:
"As a configuration file, .htaccess is very powerful. Even the slightest syntax error (like a missing space) can result in severe server malfunction."

So the conclusion is that there is a very tiny error in the .htaccess file which stops the file working as desired when a file name is used that doesn't exist. It is going to be fun trying to find that error! If we have a sharp eyed detective reading this, can you see why placing the comment at the top causes the issue stated.

# Version dated 16th November 2012
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/file1.jpg$ [OR]
RewriteCond %{REQUEST_URI} !^/file2.jpg$ [OR]
RewriteCond %{REQUEST_URI} !^/file3.jpg$
RewriteCond %{HTTP_REFERER} !^http://lorage.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://lorage.co.uk$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.lorage.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.lorage.co.uk$ [NC]
RewriteRule .*\.(jpg|js|jpeg|gif|bmp|png)$ - [F,NC]
Options -Indexes
Standard User trolleybus
(regular) Thu 22-Nov-12 10:30:15
Print Post

Re: .htaccess file


[re: trolleybus] [link to this post]
 
Following extensive testing I have found that the hash symbol ( # ) in a .htaccess file that precedes text of your choice (characters only) on a line by line basis does not affect a properly constructed set of commands from executing.

EXCEPT when using IE9 64bit. No it's not my PC at fault; I get the same results from other PCs not in my ownership. With that browser it does not return either 403 or 404 codes. Can't see what I can do about that as I can't force my site visitors to use another browser.
Standard User camieabz
(sensei) Thu 22-Nov-12 12:35:16
Print Post

Re: .htaccess file


[re: trolleybus] [link to this post]
 
Might IE9 have 'Browser Mode' or 'Document Mode' set to something like IE7, IE8, or 'quirks mode'?

~ Camieabz ~

All Connection Data ~ Some plusnet links

mod'er·a'tion n.
Synonyms: temperance, restraint, modesty.


Register (or login) on our website and you will not see this ad.

Pages in this thread: 1 | [2] | (show all)   Print Thread

Jump to