Forum Moderators: phranque

Message Too Old, No Replies

htaccess doubts

         

qimqim

4:45 pm on Nov 20, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi

Some months ago you were very kind to help me sort out my .htaccess file.

i have two little doubts

a) Webmasters Tools keeps throwing up an error regarding http://example.net/

it is the final slash that is apparently not covered in the following code:

#4a index redirect

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html
RewriteRule ^(.*)index.html$ http://example.net/$1 [R=301,L]

#4b domain-name canonicalization redirect

RewriteCond %{HTTP_HOST} !^(mysite\.net)?$ [NC]
RewriteRule ^(.*)$ http://example.net/$1 [R=301]

b) I've added a line to the file to get rid of buttons-for-website.com
is the code correct, or have I replicated [NC, OR] unnecessarily?


#1 # block visitors referred from indicated domains

RewriteCond %{HTTP_REFERER} semalt\.com [NC,OR]
RewriteCond %{HTTP_REFERER} buttons\-for\-website\.com [NC,OR]

RewriteCond %{HTTP_USER_AGENT} libwww-perl
RewriteRule .* – [F]

[edited by: Ocean10000 at 6:06 pm (utc) on Nov 20, 2014]
[edit reason] Examplified [/edit]

qimqim

6:56 am on Nov 24, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



Whoops!

I've amended my last post. Sorry!

Many thanks Lucy

Over and out
This 31 message thread spans 2 pages: 31