homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Redirect domain to Wordpress page

10+ Year Member

Msg#: 4170902 posted 5:32 pm on Jul 15, 2010 (gmt 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]

# END WordPress



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

Msg#: 4170902 posted 5:45 pm on Jul 15, 2010 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved