Redirect a Directory within a Domain?


#1

Hello,

I host a forum for a local club. Stupidly, I created this forum under my site and not as a subdomain. The domain is opentrackaction.com and the forum is located at opentrackaction.com/acmeforum/ The time has come to move the forum to the club’s own domain, so can I redirect only the /acmeforum portion of the site to the new forum at the new domain? If not, is there another way to redirect the forum?

Thanks in advance,
Scott


#2

you can redirect the whole domain… go to manage domains, edit and scroll down on the next page.


#3

That’s not the question — what OutaFocus is asking is how to redirect http://example.com/acmeforum/ -> http://acmeforum.example.com/ (for instance). You’ll need to create an .htaccess file for that.


#4

Ahhh… yea i did mis-sread the question.


#5

make a php file names index.php
just one line in it …

put it in opentrackaction.com/acmeforum

here is the line

<?php header('Location: http://newurl.com'); ?>

#6

That’s actually not a very good solution — it’ll only redirect requests for the directory itself, not any of the contents. Putting something like this in an .htaccess file in the directory to redirect will work much better:

RewriteEngine on RewriteRule ^(.*)$ http://otherdomain.com/$1 [L]