I need to redirect a parked domain (www.tuinlabo-natuurlijkkunstgras.be) to redirect to a url on the main domain (tuinlabo.be/trends).
I think the general SilverStripe .htaccess ruls might be getting in the way of this happening. Any ideas?
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I need to redirect a parked domain (www.tuinlabo-natuurlijkkunstgras.be) to redirect to a url on the main domain (tuinlabo.be/trends).
I think the general SilverStripe .htaccess ruls might be getting in the way of this happening. Any ideas?
So just to clarify, you're not actually running a SS install on the parked domain right? If not then SS really can't interfere with the redirect FROM the parked domain to the main domain. What happens when you reach tuinlabo.be/trends (if it's a SS install) might be another matter.
Smurkas, the domain is parked on cPanel (http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/ParkedDomains) So, www.tuinlabo-natuurlijkkunstgras.be and tuinlabo.be are the same server (running SS).
Oh I see. You can do a redirect of a parked domain directly in cPanel if I remember correctly. Have you tried that?
If that doesn't work you'll have to put in an extra rewrite rule that checks the domain and redirects to the right one in the SS .htaccess file.
When I add the redirect in cPanel, this gets added in .htaccess (after the SilverStripe stuff):
RewriteCond %{HTTP_HOST} ^tuinlabo\-natuurlijkkunstgras\.be$ [OR]
RewriteCond %{HTTP_HOST} ^www\.tuinlabo\-natuurlijkkunstgras\.be$
RewriteRule ^/?$ "http\:\/\/tuinlabo\.be\/trends" [R=301,L]
But it does no redirection.
Well that's because it's AFTER the SilverStripe stuff so it never matches. You need to put it before the SilverStripe stuff so that it's the first rule that gets tested.
Yup, that was it. Thanks for the help.
No prob mate, that .htaccess stuff can be really tricky.