Help me out if you can :D

Izaya

Up-and-Coming Sensation
Joined
Nov 18, 2014
Messages
346
Reaction score
0
FP$
0
SO i've asked this question of my host...who couldn't help me as well as the software people. So maybe you all can help me 😛

What I am trying to do:

I recently switched domains to a new url. We'll call it pokemon.com

I want to redirect all traffic from the old domaiN(We'll call it kangaroo.com) to pokemon.com that way if someone clicks the old domain links it'll send them to the corresponding link on the new URL.

So how do I do this via .htaccess?

I currently use friendly URLs and this is the code I got to set that up...

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


1. What do I need to add to that above to get the old url to redirect?

2. I still own the old URL...do I need to do anything with it at the registrar(point it to my host OR what)?


Cant get any concrete help from my host(managed vps) or the software provider.
 
Try this in your old domain's .htaccess file.

Code:
RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
 
Nogitsune said:
2. I still own the old URL...do I need to do anything with it at the registrar(point it to my host OR what)?

You could setup URL forwarding at the register if you wanted.
 
Sam said:
Nogitsune said:
2. I still own the old URL...do I need to do anything with it at the registrar(point it to my host OR what)?

You could setup URL forwarding at the register if you wanted.
+1.

There are a few different ways of doing it, you just got to pick the one you like best. If you want to keep the old domain online and just let an htaccess file handle it, do my solution. If you plan on getting rid of the hosting that the old domain is on, then do Sam's solution. 😉
 
Is it better to do Url redirect at the registrar then? VS .htaccess?

I have no plans to use that domain for any purpose. I just want the traffic.

So there is no old domain's .htacess file. it's just the new one's.
 
Back
Top Bottom