imperium2335 Posted November 7, 2009 Share Posted November 7, 2009 Hi, I have two domains, www.interfiber.com and www.interfiber.cn. The .cn redirects to the .com through some settings on the domain or host. What I would like to do is if someone visits via .cn, it redirects to the .com with a php variable. e.g. someone visits via .cn, ends up at www.interfiber.com?lang=Cn How do I do this redirect in the .htaccess file? Cheers, Tom. Quote Link to comment https://forums.phpfreaks.com/topic/180624-redirect-to-address-with-php-variable/ Share on other sites More sharing options...
cags Posted November 7, 2009 Share Posted November 7, 2009 Something like this should work... Options +FollowSymLinks RewriteEngine On RewriteRule ^.*$ http://www.interfiber.com?lang=cn Quote Link to comment https://forums.phpfreaks.com/topic/180624-redirect-to-address-with-php-variable/#findComment-953085 Share on other sites More sharing options...
imperium2335 Posted November 7, 2009 Author Share Posted November 7, 2009 Hi, thanks but it didn't work, just gives me a redirect loop. Quote Link to comment https://forums.phpfreaks.com/topic/180624-redirect-to-address-with-php-variable/#findComment-953092 Share on other sites More sharing options...
cags Posted November 7, 2009 Share Posted November 7, 2009 The only way you could ever get a loop is if you have it on www.interfiber.com. You need to remove any forwarding set up on interfiber.cn's domain and simply place that .htaccess file in the root directory. That will forward all requests over. Quote Link to comment https://forums.phpfreaks.com/topic/180624-redirect-to-address-with-php-variable/#findComment-953096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.