Welcome to WebmasterWorld Guest from 54.196.224.166

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect domain to Wordpress page

     

calvinmicklefinger

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

10+ Year Member



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

g1smd

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

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



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month