Solved

Redirect to new domain in Wordpress

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

733 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