Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Match OldDomain.com/unique.html to NewDomain.com/unique.html |
|
Author |
|
tekisfun
Joined: 19 Sep 2014 Posts: 2
|
Posted: Fri 19 Sep '14 23:57 Post subject: Match OldDomain.com/unique.html to NewDomain.com/unique.html |
|
|
Afternoon all,
I have moved my website from one domain to another.
The links from other people's sites to my old domain's content go to a blank page or get redirected to the new domain's homepage only.
Is RedirectMatch the right tool for having the example below work:
www.OldDomain.com/unique.html
to get perfectly redirected to
www.NewDomain.com/unique.html
Thanks for ideas! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 24 Sep '14 1:28 Post subject: |
|
|
If you have just that one url,yes. Else a rewrite rule makes more sense |
|
Back to top |
|
tekisfun
Joined: 19 Sep 2014 Posts: 2
|
Posted: Wed 24 Sep '14 2:08 Post subject: |
|
|
@james blond
Thanks for the feedback. I'll research rewrite rules now unless you can point me in a specific direction |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 24 Sep '14 21:46 Post subject: |
|
|
Quick example written on my phone so excuse typos
Code: |
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
|
|
|
Back to top |
|
|
|
|
|
|