Forum Moderators: phranque

Message Too Old, No Replies

301 and 404

         

blaketar

4:09 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



Hi all, any know off hand the directive to use in a <VirtualHost> to send ALL, not just the main url to a 301 redirect?

Currently I have a:

<VirtualHost *.*.*.*>
ServerName www.widget.com
Redirect permanent / [newwidget.com...]
</VirtualHost>

But when someone pulls an old file index (http://www.widget.com/cgi-bin/file.cgi) from a search engine they get a 404 / Page not Found. How can all requests be sent the 301?

jdMorgan

6:50 pm on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> But when someone pulls an old file index (http://www.widget.com/cgi-bin/file.cgi) from a search engine they get a 404 / Page not Found. How can all requests be sent the 301?

To redirect all of widget.com to newwidget.com, just fix your syntax:

Redirect permanent / [newwidget.co[b]m...]

This will redirect any resource requested in widget.com (where this directive is installed) to the same resource on newwidget.com. See Apache mod_alias [httpd.apache.org]. This assumes that widget.com and newwidget.com are on different servers or virtual servers. If not, then you'll need to use mod_rewrite to test HTTP_HOST to avoid an infinite redirection loop.

If that is not what you are trying to do, please post more details.

JIm