T
T
Tenebrius2015-12-07 11:02:00
htaccess
Tenebrius, 2015-12-07 11:02:00

How to swap domain and subdomain?

There is a site site.com and the second sub.site.com.
You need to swap them. Those. so that those who type "site.com" see "sub.site.com" and vice versa.
Is it enough to set up a redirect in htaccess? Is it possible to do so at all?
And, if not difficult, how to do it?
I'm afraid? if you do it like this:

RewriteRule ^sub.site.com/(.+)$ site.com/$1 [QSA,L]   
RewriteRule ^site.com/(.+)$ sub.site.com/$1 [QSA,L]

There will be an endless redirect.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2015-12-07
@zooks

You need to configure the paths to the folders with the site and subsite. Or rename them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question