php redirect pages under folder to different domain
<p>Using php, how might I redirect all pages under a folder to a different domain? </p>

<p>Current site:</p>

<pre><code>http://www.example.org/dept
http://www.example.org/dept/stuff
http://www.example.org/dept/more
http://www.example.org/dept/more/stuff
</code></pre>

<p>New site:</p>

<pre><code>http://www.example-too.org/pets/stuff
http://www.example-too.org/pets/more
http://www.example-too.org/pets/more/stuff
</code></pre>

<p>I've learned about how to redirect a single page:</p>

<pre><code>&lt;?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example-too.org/pets/more/stuff" );
?&gt;
</code></pre>

<p>but how to apply this to dozens of pages without creating a php redirect for each one?</p>

<p><strong>[edit]</strong> I understand using web server config (apache mod_rewrite) and/or .htaccess is the best way to handle multiple redirects like this, but I those options aren't available to me.</p>

<p>thanks.</p>
