heyxmvck
heyxmvck

Reputation: 11

redirecting parked domain and their old urls to new domain

I need some help with htaccess and redirection. I have a domain - sp-gd.com. On top of this domain I have 2 parked domains; suryaprasetya.com and suryaprasetya.com.au.

I have already set up 301 redirection for the parked domains so it will go to sp-gd.com. What I want to do is for the old urls from parked domains to redirect to new domain.

Note that I have switched the hosting and it is under sp-gd.com

heres my htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d     
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.+) /index.php
RewriteCond %{HTTP_HOST} ^suryaprasetya\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.suryaprasetya\.com$
RewriteRule ^/?$ "http\:\/\/www\.sp\-gd\.com" [R=301,L]
RewriteCond %{HTTP_HOST} ^suryaprasetya\.com\.au$ [OR] 
RewriteCond %{HTTP_HOST} ^www\.suryaprasetya\.com\.au$
RewriteRule ^/?$ "http\:\/\/www\.sp\-gd\.com" [R=301,L]

have tried putting

RewriteCond %{HTTP_HOST} ^suryaprasetya\.com\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.suryaprasetya\.com\.au$
RewriteRule ^/portfolio http://www.sp-gd.com [R=301,L]

and its not working

Basically what I wanna do is to redirect any urls requested using parked domain names to the new domain...

Upvotes: 0

Views: 1193

Answers (2)

HostKing
HostKing

Reputation: 36

Weird, I have the exact same changes in my .htaccess file:

RewriteCond %{HTTP_HOST} ^hostkingonline\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.hostkingonline\.com$
RewriteRule ^/?$ "http\:\/\/www\.hostking\.co\.za" [R=301,L]

They seem to work quite well. Can't see any difference in mine compared to yours.

If all else fails and using cPanel as your control panel you can redirect it via the Parked Domains icon and manage redirection option.

Also found this that may be useful for apache changes: Problems redirecting old domain to new with Apache and htaccess

Upvotes: 0

Jon Lin
Jon Lin

Reputation: 143896

Change your 2 R=301 rules to this:

RewriteRule ^(.*)$ http://www.sp-gd.com/$1 [R=301,L]

Upvotes: 0

Related Questions