Redirect vs Rewrite subfolder/subdomain question


#1

OK, I’ve tried searching for what is going on and I’m getting confused on what I should put in my .htaccess file to do what I want.

We transferred our site from a previous host to Dreamhost and all went swimmingly. We recently needed to give one of our users full admin rights and code control over our forums only which had previously been at http://www.mydomain.com/forums, so we created a forums.mydomain.com subdomain so he could do what he needed to do.

However, many of our users still have the http://www.mydomain.com/forums bookmarked, and I would prefer to not have to put up a page that says “we’ve moved!”

I have three questions:

  1. what is the best way in .htaccess to have anyone who types in http://www.mydomain.com/forums be redirected to http://forums.mydomain.com?

  2. Would setting up this redirect or rewrite break links to other posts/topics within the forum (ie, if I set up the redirect, would a link to http://www.mydomain.com/forums/topicID=2324&postid=4352
    still work)

  3. Once I am sure that http://forums.mydomain.com is working, can I remove the /home/mydomain.com/forums subfolder completely from the server on the www.mydomain.com ftp account?


#2

Try this first:

[color=#00CC00]Panel > Domains > Remap Sub-Dir[/color]

Remap domain.com/forums to /home/someuser/forums.domain.com

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Ugh - I realize I didn’t explain the issue completely (or accurately) -forgot to mention the complicating issue!

we have mydomain.net registered with DH, while the original mydomain.com is still with the old registrar and won’t be able to be transferred due to contractual issues for a few months at least. mydomain.com is set up as a mirror of mydomain.net

So we have the following domains
mydomain.net - fully hosted by DH
mydomain.com - registered w/another company, configured to mirror mydomain.net
forums.mydomain.com - fully hosted by DH

the forum files were originally at (and are technically still there) /home/adminuser/mydomain.net/forums, and were copied to /home/forumadmin/mydomain.net/forums.
forums.mydomain.com uses /home/forumadmin/mydomain.net/forums (both locations share the same database - we haven’t updated some of our internal site links either - so users on the front end don’t notice any difference right now)

So will there be any problems if I remap mydomain.net/forums to /home/forumadmin/mydomain.net/forums ?

(believe me, I wish things weren’t so inelegant, but we had issues securing the .com address and had to go this route so we could get up and running until all the contracts involved expire :slight_smile: )


#4

> So will there be any problems if I remap mydomain.net/forums to /home/forumadmin/mydomain.net/forums ?

If the forum is functioning at DH in the domain.net/forums/ directory, and all files have been copied into the new subbie, then everything should be fine after remapping.

It would still pay to update any hard coded paths in config.php or within the database to reflect the new location.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost