Solved

Redirect to new domain in Wordpress

Posted on 2013-06-26
5
286 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
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 6

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 500 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now