I wanted to implement the right code when redirecting a folder to a subdomain. I have an old folder /public_html/folder1 that I moved to a new subdomain "old.domain.com/folder1/". Im I using the right code?
as I never mix RewriteRule (mod_rewrite) with directives using mod_alias (Redirect/RedirectMatch) in the same site.
I use two lines of code so that index requests do not invoke an unwanted redirection chain.
This avoids all kinds of difficult-to-diagnose problems.
digic
4:57 pm on Jul 21, 2011 (gmt 0)
Thanks g1smd. My code is showing "too many redirect errors" in Chrome. In IE, it takes time for the page to load.
Actually, the old design have dozens of .htm files and folders (with .htm files also) which I want to move to a subdomain. Right now, I am using wordpress to run the site. Still I dont want to delete old .htm files since they are still useful.
Should I write one rewrite rule for each folder? What about all the .htm files that was moved to a subdomain?
Im sorry, I am confuse with these codes.
digic
5:13 pm on Jul 21, 2011 (gmt 0)
To give you a better view, here is how the old design looks. All in .htm file. /public_html/ index.htm aaa.htm bbb.htm ccc.htm /folder1/ddd.htm (and so on) /folder2/eee.htm (and so on)
So I created a subdomain "old" to move all old files like this: /public_html/old/ index.htm aaa.htm bbb.htm ccc.htm /folder1/ddd.htm (and so on) /folder2/eee.htm (and so on)
Under /public_html/ or root, there are Wordpress files and folders which I dont want to get affected. Thanks
lucy24
7:15 pm on Jul 21, 2011 (gmt 0)
Wait, wait. Is it old.domain.com/ or is it domain.com/old/ or is it both [httpd.apache.org]? That is, what the user sees and the real location of the file may or may not be the same.
digic
5:48 am on Jul 22, 2011 (gmt 0)
The newly created subdomain is old.domain.com and if your browsing the folders via FTP it is under /public_html/old/(all files and folders must go here).
So if visitors browse /public_html/old/folder1/ddd.htm he would get a URL [old.domain.com...]