Forum Moderators: phranque

Message Too Old, No Replies

Is my .htaccess causing a 403 Forbidden?

         

TravelSite

1:18 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



I was testing out one of my sites on various url checker websites - and noticed that they thought my site was returning a "403 Forbidden" error.

I can view my site fine in IE - but was wondering if something in my .htaccess file was wrong. Google also doesn't seem to want to index it (though it appears on Yahoo).

My .htaccess is:

# Version: 07 November 2005 21:14
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
rewritecond %{HTTP_HOST} ^(.*).net(.*)$
rewriteRule ^(.*)$ [MYDOMAIN.com...] [R=301,L]
rewritecond %{HTTP_HOST} ^(.*).co.uk(.*)$
rewriteRule ^(.*)$ [MYDOMAIN.com...] [R=301,L]
RewriteCond %{HTTP_HOST}!^www\.*
RewriteRule (.*) [%{HTTP_HOST}...] [R=301,L]
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ [%{HTTP_HOST}...] [R=301,L]
RewriteRule ^([^.]+)\.htm$ $1.php [NC,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.php [NC]
RewriteRule \.php %1.htm [NC,R=301,L]

Is this file ok? Thanks

jdMorgan

3:26 pm on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's possible that you or your host have additional access restriction code that affects requests from "various checker sites," but there's nothing in the code you posted that generates a 403-Forbidden response.

It looks to me like you could accomplish what you need with far simpler code, but I'd recommend that you resolve the 403 error before changing it.

If you need another headers checker to try, here's ours [webmasterworld.com].

Jim

TravelSite

4:51 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



Hi Jim,

Thanks for that link - the first line came back with "HTTP/1.1 200 OK" so I guess it must be okay.

My code does look like its repeating 3 almost identical steps but I'm afraid what I've done so far has already reached the limit of my .htaccess skills :)