Hosting WordPress website inside another website

Topics: User Forum
May 4, 2010 at 2:34 PM

Hello,

I am trying to host a new WordPress site/blog in a subfolder of another existing website and point a new domain to that subfolder without the user to know.
for example:
Exisiting website: www.MyDomain.com
New Domain: www.MyBlog.com
Blog (WordPress) subfolder: ./Wordpress

What I am trying to accomplish is:

1. if someone enters: "www.MyBlog.com" it wil REWRITE to "www.MyDomain.com/WordPress"  (which means the user keeps seeing "www.MyBlog.com") - This I think I got right  (Rule #4 in the example below)

2. If someone enters "www.MyDomain.com/WordPress" it will REDIRECT/REWRITE (i am not sure here) to "www.MyBlog.com" (which means the user will see "www.MyBlog.com" ) - This I got only half right. First it seems to work properly but I cannot login to Wordpress. My guess is that it does not work well with sub-sub folders or something like that. (Rule #3 in the example below)

3. Remove the "www" from www.MyBlog.com and www.MyDomain.com - This works well.  (Rules #1,#2 in the example below)

Here is my IIRF (v2.x) installed on Windows 2003 virtual server:

RewriteLog D:\xxx\iirfLog.out
RewriteLogLevel 3
MaxMatchCount 10
StatusUrl /iirfStatus
RewriteEngine ON

RewriteCond %{HTTP_HOST} ^(www\.MyDomain\.com).*$ [I]
RedirectRule ^/(.*)$ http://MyDomain.com/$1 [I,R=301]

RewriteCond %{HTTP_HOST} ^(www\.MyBlog\.com).*$ [I]
RedirectRule ^/(.*)$ http://MyBlog.com/$1 [I,R=301]

RewriteCond  %{HTTP_HOST}  ^MyDomain\.com$  [I]  
RedirectRule ^/WordPress/(.*)$       http://MyBlog.com/$1 [I,R=301]            

RewriteCond  %{HTTP_HOST}  ^MyBlog\.com$      [I]
RewriteRule  ^/(.*)$       /WordPress/$1                [L]

 

Please advice, especially regarding the 3rd rule..

 

Thanks!

Oren.