Forum Moderators: phranque
I changed path of one of the article and it was spidered by Zealbot, so I made a 301 redirect to the new path. ".htaccess" file with redirect is in the root of the server.
Now, Apache, redirects to a new path, plus adding query string that it rewrites to Perl script.
This is very confusing, but here is an example.
Old path:
/articles/bluewidget/ /articles/very_blue_widgets/ /articles/ folder: RewriteRule ^([a-zA-Z0-9_-]*)/?$ /cgi-bin/art.pl?path=$1&display=1 redirect 301 /articles/bluewidget/ http://www.widgets.com/articles/very_blue_widgets/ http://www.widgets.com/articles/very_blue_widgets/?path=very_blue_widgets&display=1 How can I prevent this kind of rewrite?
This must be some weird interaction between mod_alias and mod_rewrite. I've looked at it for several minutes, and I can't figure out why it does not rewrite to the art.pl path.
Try doing the whole thing in mod_rewrite in your /articles subdirectory:
RewriteRule ^bluewidget/$ http://www.widgets.com/articles/very_blue_widgets/ [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]*)/?$ /cgi-bin/art.pl?path=$1&display=1 [L]
Jim