Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Redirect to new domain in Wordpress

Posted on 2013-06-26
5
Medium Priority
?
303 Views
Last Modified: 2013-06-27
Yet again baffled by .htaccess

I have this site : http://www.marlboroughworldleather.com

Which I want to redirect, keeping the URLs after the domain intact to this :

http://www.marlboroughworld.com/

I've got this in .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.marlboroughworldleather.com
RewriteRule (.*) http://www.marlboroughworld.com/$1 [R=301,L]

However it only redirects if the domain is typed in, for example, I can still go here :
http://www.marlboroughworldleather.com/product-category/homeoffice/ipad-and-iphone-cases/

When it should redirect to here :

http://www.marlboroughworld.com/product-category/homeoffice/ipad-and-iphone-cases/

Any ideas?
0
Comment
Question by:andythecal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39277691
Wouldn't this be better? Can't test if it would be.

RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

Open in new window

0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39277699
Are you using SSL? This will only redirect non SSL. Another option would be to use php.
0
 

Author Comment

by:andythecal
ID: 39278125
Tried spravtek's solution but I get the same, anything outside the root path isn't redirected.

Nope - not SSL.
0
 
LVL 4

Accepted Solution

by:
ScorchD earned 2000 total points
ID: 39278872
This issue is explained well here, I have had to do this a few times.

http://stackoverflow.com/questions/5690673/wildcard-domain-redirect-with-wordpress
0
 

Author Closing Comment

by:andythecal
ID: 39281019
Bang on! Worked a treat.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question