Forum Moderators: phranque

Message Too Old, No Replies

(Repost) URLs restricted by robots.txt - AGH!

I'm a bit stumped about what's best to do re my robots.txt

         

wrafter

8:41 pm on Apr 25, 2007 (gmt 0)

10+ Year Member



Apologies to anyone who has seen this elsewhere on this site, but I came here to specific section of the forum to get final confirmation on the best move to make regarding the following, your advise much appreciated.

Would you be kind enough to take a look at the short thread here: [webmasterworld.com...] and advise? (read post four to see my specific problem related to the 54 issues with my site).

Thank you.

jdMorgan

9:14 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> thedomaininquestion.com/reviews.php?id=128 SHOULD BE thedomaininquestion.com/review.php?id=128

Assuming that you already have working RewriteRules in your .htaccess file, the following rule will redirect from reviews.php to review.php, while retaining the original query string:


RewriteRule ^reviews\.php$ http://example.com/review.php [R=301,L]

You will need to "set up" mod_rewrite if this has not already been done:

Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^reviews\.php$ http://example.com/review.php [R=301,L]

Note that the Options directive is not needed on some servers, not allowed on other servers, and required on still others -- You will need to test to find out.

And for use in httpd.conf, the pattern will need a leading slash:


RewriteRule [b]^/r[/b]eviews\.php$ http://example.com/review.php [R=301,L]

Jim

wrafter

7:53 pm on Apr 28, 2007 (gmt 0)

10+ Year Member



Thank you jdMorgan for the very considered and much appreciated response.