htaccess redirect a subdomain of a wordpress network site to a page

I am currently running a subdomain WordPress Network at domain1.org. One of the subdomain sites is domain mapped to domain2.org. I am trying to add a subdomain to domain2.org that will appear as sample.domain2.org. The problem is that the domain2 is pointed to domain1. We don’t use wildcards, we manually edit the DNS for each subdomain site (server admin rule). Tried a redirect rule like Redirect 301 http://friend.episode13.org/ http://episode13.org/friend/

Thoughts?

Related posts

Leave a Reply

1 comment

  1. You need to setup a vhost for friend.episode13.org, and in that vhost redirect to http://episode13.org/friend/:

    Redirect 301 / http://episode13.org/friend/
    

    Otherwise, you can try using mod_rewrite and in the vhost (or htaccess file in the document root) where the friend.episode13.org subdomain points to, add:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^friend.episode13.org$ [NC]
    RewriteRule ^/?(.*)$ http://episode13.org/friend/$1 [L,R=301]