
Originally Posted by
satori83
- do I have to write separate redirects for each domain twice, or is there a all inclusive way to do this?
You can do this in one go. Either just redirect everything that is not the domain you want to the primary domain, or by using www as an optional atom
Code:
# pre-requisites for mod_rewrite
# needed for both methods
Options +FollowSymlinks
RewriteEngine on
# Method 1: REWRITE *ALL* THE THINGS!
RewriteCond %{HTTP_HOST} !^www\.primarydomain\.com$ [NC]
RewriteRule .? http://www.primarydomain.com%{REQUEST_URI} [L,R=301]
# Method 2: Optional www
RewriteCond %{HTTP_HOST} !^(www\.)?some-secondary-domain\.com$ [NC]
RewriteRule .? http://www.primarydomain.com%{REQUEST_URI} [L,R=301]
Don't use both methods at once. Pick one and stick with it.

Originally Posted by
satori83
- can i redirect a folder? Like say mydomain.com/newfolder to mydomain.com/service-areas? Or would I have to redirect every page within the folder?
Yes you can redirect a folder. The easiest way is to use
Code:
Redirect /newfolder http://www.primary-domain.com/service-areas

Originally Posted by
satori83
- and lastly, would these folder or individual page redirects need to be done for each of the four domains?
That depends on how it's set up. If all domains are served from one directory you can apply method 1 from answer 1 just once. If they run from multiple directories you need to it apply it once for every directory.
Also, I would put the redirect before the other Rewrite, because otherwise you'd have to redirect twice, once to the correct domain, and then once to the correct directory. Whereas if you put it first it redirects to the correct domain and folder at the same time.
Bookmarks