Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Redirecting Subdomain to Subdirectory (after moving WordPress blog)

Status
Not open for further replies.

swperry

IS-IT--Management
Oct 28, 2012
1
0
0
US
I had a static site with a WordPress blog in a subdomain. When I created a new site in WordPress, I installed WordPress in a subdirectory rather than asubdomain. I then forwarded the subdomain blog.example.com to example.com/blog. That works if someone is looking for the old home page of the blog. (They’re directed to the new blog home page.) My problem is that I haven’t been able to figure out how to redirect individual posts that used to be in blog.example.com (for example, blog.example.com/post1). If someone clicks on an old link, they end up with a 404 page-not-found error.

This is what I have in my .htaccess:

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

# END WordPress

I would be extremely grateful to anyone who can help me. I’ve been researching this for many hours and I have tried multiple suggestions but I don’t really understand how to get this to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top