Forum Moderators: phranque

Message Too Old, No Replies

Robots.txt Redirection

         

pandav

6:34 pm on May 4, 2009 (gmt 0)

10+ Year Member



I need help in implementing Rewrite Rule on to IBM Http Server,

we are doing permanent redirect to www.mydomain.com/abc/xyz and want to access Robots.txt file e.g. www.mydomain.com/robots.txt from root level but instead of getting Robots.txt file when we type www.mydomian.com/robots.txt, permanent is redirecting to www.mydomain.com/abc/xyz instead of giving robots.txt file.

please help me to put a rewriteRule to get robots.txt file and I want to keep permanent redirect as well.

Ps: after disbaling permanent redirect i can get robots.txt and also my usinf index.html at root level i can get that but we want to get it with permanent redirect.also i am able to access robots.txt via http not https?

Thanks,
Pan

g1smd

9:16 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need to add something to your rule so that requests for robots.txt are not redirected.

Since you provided no code for what you already have, then it is not possible to say how that code should be amended.

pandav

2:41 pm on May 5, 2009 (gmt 0)

10+ Year Member



below is the simple permanent redirect we are doing,could you please tell me how to put Rule at root level so that requests for www.mydomain.com/robots.txt will not redirect to permanent path?

<virtualhost <name>:ssl port>
ServerName www.mydomain.com
RedirectMatch permanent ^/$ [mydomain.com...]
</virtualhost>

<virtualhost <name>:non ssl port>
ServerName www.mydomain.com
SSLDisable
RedirectMatch permanent ^/$ [mydomain.com...]
</virtualhost>

thanks,
pan

g1smd

11:35 pm on May 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Change from RedirectMatch to RewriteRule and adjust syntax to match, and add a RewriteCond that excludes requests for robots.txt and other files that the redirect should not be actioned for.

pandav

12:56 am on May 6, 2009 (gmt 0)

10+ Year Member



thanks for help, could you help me out with example i am new in apache thing.

jdMorgan

1:21 am on May 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It does not look like your two RedirectMatch directives affect anything except the "home page" at "example.com/". They should have no effect whatsoever on any URL-path except for "/".

Look for Alias directives or any .htaccess files which may contain other Redirect or RewriteRule directives which may be interfering with robots.txt.

Jim

pandav

5:53 pm on May 6, 2009 (gmt 0)

10+ Year Member



yes you are right, We have TAM authorization server in front of Http server which was sending "example.com/ to "example.com/whatever redirect on http".
I uauthenticate "example.com/robots.txt" (ssl) from TAM side and it works.non-ssl was working before becasue that was not protected by TAM.

thanks very much,
pan