Solved

Redirect to new domain in Wordpress

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
logo disappears on cell phones 5 57
remove element from displaying on mobile devices 3 71
drop down navigation on mobile devices adds spaces 3 77
CSS z-index issue 3 20
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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 create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…

920 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

16 Experts available now in Live!

Get 1:1 Help Now