Welcome to WebmasterWorld Guest from 18.206.15.215

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

htaccess problems

     
8:48 pm on Sep 4, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:June 18, 2005
posts:49
votes: 0


hello, I tried to search in some of the other threads but didnt come up with anything. I would really appreciate it if someone could offer a suggestion as to why my code doesnt work...

Thanks in advance.

RewriteEngine on
Redirect /index.html [mysecondsite.com...]
ErrorDocument 400 /mysecondsite.com
ErrorDocument 401 /mysecondsite.com
ErrorDocument 403 /mysecondsite.com
ErrorDocument 404 /mysecondsite.com
ErrorDocument 500 /mysecondsite.com
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?myfirstsite.com.com [NC]
RewriteRule \.(jpg¦jpeg¦png¦gif)$ - [NC,F,L]

4:47 pm on Sept 5, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 18, 2001
posts:889
votes: 0


I'm no expert on this but since no one has offered an answer yet I'll offer a couple suggestions. This will also bump the post up and somone more knowledegable may answer.

Redirect /index.html [mysecondsite.com<...]
The correct form for a redirect should include the filename to be redirected to
RedirectPermanent /index.html [mysecondsite.com...]

ErrorDocument 400 /mysecondsite.com
ErrorDocument 401 /mysecondsite.com
ErrorDocument 403 /mysecondsite.com
ErrorDocument 404 /mysecondsite.com
ErrorDocument 500 /mysecondsite.com

these statements should name the actual error filname not the the domain
ErrorDocument 401 /error401filename.htm
ErrorDocument 403 /error403filename.htm
ErrorDocument 404 /error404filename.htm
ErrorDocument 500 /error500filename.htm

RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?myfirstsite.com.com [NC]
RewriteRule \.(jpg¦jpeg¦png¦gif)$ - [NC,F,L]

I'm not sure what you are trying to do here but based on the last line it looks like you are trying to prevent hotlinking. There are a lot of threads on hotlinking and you might want to check this post [webmasterworld.com] out. Make sure you read jdmorgan's response. Or, you could read these other threads about hotlinking [google.com].

Pay careful attention to spacing especially before a !. This forum software inserts a broken pipe where a solid pipe is used. Make sure you replace all the broken pipes with solid pipes.