php redirect pages under folder to different domain
- by matt wilkie
Using php, how might I redirect all pages under a folder to a different domain?
Current site:
http://www.example.org/dept
http://www.example.org/dept/stuff
http://www.example.org/dept/more
http://www.example.org/dept/more/stuff
New site:
http://www.example-too.org/pets/stuff
http://www.example-too.org/pets/more
http://www.example-too.org/pets/more/stuff
I've learned about how to redirect a single page:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example-too.org/pets/more/stuff" );
?>
but how to apply this to dozens of pages without creating a php redirect for each one? I can't do this using apache mod_rewrite and .htaccess is disabled.
thanks.