Forum Moderators: phranque

Message Too Old, No Replies

Redirect single page across several domains

'dynamic' redirect

         

xyzmedia

3:05 pm on May 23, 2008 (gmt 0)

10+ Year Member



I have searched high and low for this and I'm sorry if the answer is out there and I just didn't understand.

I have several domains that I have set up so that all of their httpdocs directories are actually symbolic links to one main httpdocs directory. I created one form to combine the functionality of several existing forms and I would like to replace all of the existing forms with this one. I don't want to use a header or meta redirect on all of the pages but would instead like to put permanent redirects in the .htaccess file to take care of this. Is there any way to create a single page redirect that points to a different page on a dynamic domain?

For example:

Redirect 301 /oldpage.php [domain.com...]

will not work because I can't specify 'domain'. It could be any of several domains and I need to preserve the domain name.

Can anyone help? Thank you in advance for your assistance.

jdMorgan

3:51 pm on May 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mod_alias cannot do this, but mod_rewrite can:

Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^oldpage\.php$ http://%{HTTP_HOST}/newpage.php [R=301,L]

Jim

xyzmedia

4:01 pm on May 23, 2008 (gmt 0)

10+ Year Member



That works perfectly! Thank you so much. I'm not so good at this stuff and I would have been at it for days.