[thelist] 301 redirects in htaccess

John Allsopp john at johnallsopp.co.uk
Sat Aug 4 07:51:39 CDT 2012


/*
John Allsopp said:

This
   http://www.johnallsopp.co.uk/blogViewer.php?blog=2012
is now this
   http://www.johnallsopp.co.uk/oldSite/blogViewer.php?blog=2012

and this
   Redirect 301 blogViewer.php
   http://www.johnallsopp.co.uk/oldSite/blogViewer.php
in .htaccess isn't doing it.

Do you know how to catch any URL with blogViewer in it and route it to
the oldSite page, and retain all that comes after? Do tell.

David Kaufmann said:
try this:

   RewriteEngine On
   Rewrite Base /
   RewriteCond %{REQUEST_URI}   !oldSite/
   RewriteRule blogViewer(.*)$  oldSite/blogViewer$1 [R,L]
*/

Thanks muchly, sorry for delay in replying:

I got error 500, Internal Server Error :-(

Error log said:
[Sat Aug 04 08:35:17 2012] [alert] [client ..] 
/home/../public_html/.htaccess: Invalid command 'Rewrite', perhaps 
mis-spelled or defined by a module not included in the server configuration

I Googled and tried RewriteBase but still got error 500, but this time with:

[Sat Aug 04 08:38:26 2012] [alert] [client ...] 
/home/.../public_html/.htaccess: Invalid command '//Redirect', perhaps 
mis-spelled or defined by a module not included in the server configuration

that, was due to me commenting out the original line
Redirect 301 ^blogViewer\.php$ /oldSite/blogViewer.php
with a // instead of a #

So, it's working now I've used #

but

I think it's giving a 302 where I think I want a 301 .. so how do I do that?

ATB
J

-- 
-------------------------------------------------------------
John Allsopp
tel: 01723 376477
Twitter: @JohnAllsoppIM



More information about the thelist mailing list