Aliasing domains in WordPress

Using a single web hosting account to host multiple sites

Aliasing domains in WordPress

Postby DailyNews » Mon Dec 24, 2007 8:56 am

I have WordPress set up on a domain that I don’t want to expose. It powers four other domains.

We’re doing this right now with an old installation of ezPublish and want to kick over to the fantastic features of WP, which we’ve been working on for months.

So:

www.masterdomain.com hosts the admin software and is, in fact, the only “real” domain.

www.domain1.com
www.domain2.com
www.domain3.com and
www.domain4.com

Are all pointed at their respective home directories (www.masterdomain.com/category/domain1, etc).

This much, we can do in WP and .htaccess.

But our current installation of ezPub also rewrites the domain name so that

www.masterdomain.com/domain1

shows up in the browser as

www.domain1.com

..and all subpages and sections show up under their aliased domains.

We can’t find a way to do this in WP and our server-level attempts have failed.

Any good ideas out there?
DailyNews
 
Posts: 4
Joined: Mon Dec 24, 2007 8:52 am

Postby richardk » Mon Dec 24, 2007 10:05 am

So you want to have example1.com/anything in the address bar and have it go to masterdomain.com/category/example1/anything?

What directory(s) on the server do the not "real" domains currently go to? (With no mod_rewrite.)

What is you current Wordpress mod_rewrite like? Have you looked at Wordpress MU?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

mod rewrite

Postby DailyNews » Wed Dec 26, 2007 5:58 am

Currently example1.com goes to masterdomain.com/category

We still want it to do that but we want it to appear as example1.com/category

The url's are pointing to the root.

This is our current mod_rewrite


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteEngine On

RewriteCond %{SERVER_NAME} .*example1.com
RewriteRule ^$ http://example1.com/category/example1-home [R]


RewriteCond %{SERVER_NAME} .*example2.com
RewriteRule ^$ http://example2.com/category/example2-home [R]

Thanks
DailyNews
 
Posts: 4
Joined: Mon Dec 24, 2007 8:52 am

Postby richardk » Thu Dec 27, 2007 10:17 am

Try
Code: Select all
Options +FollowSymLinks

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteCond %{HTTP_HOST} ^(.+\.)?example1\.com$ [NC]
  RewriteRule ^$ http://example1.com/category/example1-home [R=301,L]

  RewriteCond %{HTTP_HOST} ^(.+\.)?example2\.com$ [NC]
  RewriteRule ^$ http://example2.com/category/example2-home [R=301,L]

  RewriteCond %{SCRIPT_FILENAME} !-f
  RewriteCond %{SCRIPT_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby DailyNews » Fri Jan 04, 2008 1:48 pm

Thanks,

I tried and it didn't work. I will keep playing around.

any other ideas?

Thanks
DailyNews
 
Posts: 4
Joined: Mon Dec 24, 2007 8:52 am

Postby richardk » Fri Jan 04, 2008 1:58 pm

When you go to example1.com/ you are not redirected to example1.com/category/example1-home? Is that what you want?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby DailyNews » Fri Jan 04, 2008 3:01 pm

When I go to example1.com I get redirected to

example.com/category/example1-home

I would like it to read

example1.com/category/example1-home

It continues to display the domain that the install of wordpress is on, the re-direct works perfectly, but I guess I want it to mask the domain as well.

I may have worded that incorrectly.

Thanks so much for the help.
DailyNews
 
Posts: 4
Joined: Mon Dec 24, 2007 8:52 am

Postby richardk » Sat Jan 05, 2008 10:13 am

You have it like
Code: Select all
RewriteCond %{HTTP_HOST} ^(.+\.)?abcdef\.com$ [NC]
RewriteRule ^$ http://abcdef.com/category/abcdef-home [R=301,L]

and not
Code: Select all
RewriteCond %{HTTP_HOST} ^(.+\.)?abcdef\.com$ [NC]
RewriteRule ^$ http://example.com/category/abcdef-home [R=301,L]

right?

Then it's almost certainly Wordpress causing the redirect and you'd have to edit Wordpress (or find the setting) to stop that.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 17 guests

cron