Welcome to WebmasterWorld Guest from 54.147.44.13

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect domain to Wordpress page

     
5:32 pm on Jul 15, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 11, 2005
posts: 129
votes: 0


I have a wordpress blog at www.example.com and a page at www.example.com/parent/page/

I also have a second domain (www.seconddomain.com) pointing to the same hosting account. I would like to have this domain actually point to the specific page at www.example.com/parent/page/

I have experimented with adding a Rewrite Condition and Rewrite Rule, as shown in the code below, but it is having no effect.

Can anyone advise me what to correct?


# I inserted these two lines
RewriteEngine On
RewriteBase /

# I also inserted these two lines
RewriteCond %{REQUEST_URI} =payclerk.com
RewriteRule ^ /niches/payclerk-payroll/ [R=301]


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

# END WordPress
5:45 pm on July 15, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


REQUEST_URI looks at only the path, not the domain.

HTTP_HOST looks at the domain name. Use that instead.


The [R=301] flag makes this a redirect. You need a rewrite so replace that with [L] instead.


Your Wordpress rewrite can be optimised quite a bit. There are several prior threads in this forum with exact code details.