I have an issue that I hope you can help me with and I hope I am clear with this one. I moved a domain that I had, http://www.mydomain.com to a sub domain and it is now http://abc.mydomain.com and put phpld in the root domain. I would now like to redirect any calls to specific pages like http://www.mydomain.com/page1.html to http://abc.mydomain.com/page1.html. A call to a specific page at abc.mydomain.com always takes me back to the php root. I am assuming this is an .htaccess file/rewrite issue but don't know enough about either to fix it. I have done a search on the forum but all i find is the redirection the other way around. Any help would be appreciated.
Hey, Yes it is a mod rewrite issue, however before I can help you fix it I need to know why you have moved your web site to a sub domain? Did you move it so that you could construct another web site under the root domain? The reason is that the most generic fix for this would be to rewrite every single request and transfer it through to the new domain. But if you are going to build a new web site on the root domian, then there will obviously be pages which should be excluded. PS: Cute dog, check out my husky, third post under the same username: http://forums.devshed DOT com/php-development-5/what-is-the-newline-return-code-419137.html
I did put a new site in the root and I do want to redirect every old page. What is the most generic way to do that? I can't get to that link to see your husky (damn it ) Thanks again
Hi, Sorry, I am new to the forum so it won't let me post the proper URL's Anyway, glad you got to see Lua, I have also added her here too. So she should show up on this post. We only have one at the moment, but when we get a bigger place we hope to find a partner for her.... Now onto your problem, the fastest way to achieve this is as follows: RewriteCond %{HTTP_HOST} !abc\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://abc.mydomain.com/$1 [R=301,L] Code (markup): What this basically says is, if the domain isn't abc... then redirect it to abc... with anything after the / appended.