user3331187
user3331187

Reputation: 1

.htaccess to rewrite to subfolder & different URL

I've got a site that's setup as a WordPress network/subsite off primary url.

domain.org/subsite

I'd like to rewrite requests from a seperate DNS name - call it domain2.org - (which I control) to that subsite

domain2.org -> domain.org/subsite

I've seen examples of using .htaccess rewrites to route to subfolder, but can't figure out specifics on how to do this.

Thanks for looking.

Upvotes: 0

Views: 87

Answers (2)

Armstrong Bala
Armstrong Bala

Reputation: 9

I had an experience working with wordpress multisite which is hosted at godaddy.

Godaddy has an option for the registered domain say for eg http://domain2.org asked for hosting server point or url. In the url field paste it http://www.domain.org/subsite

So check with your hosting provider.

Upvotes: 0

anubhava
anubhava

Reputation: 785246

put this code in your DOCUMENT_ROOT/.htaccess file of domain2:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.org$ [NC]
RewriteRule ^ http://domain.org/subsite%{REQUEST_URI} [R=301,L,NE]

Upvotes: 0

Related Questions