Discussion .htaccess file does not work on new hosting Plateform

swetajoshi

Junior Member
Jun 27, 2021
2
2
41
Hello everyone, recently I moved my website from old Linux VPS Hosting to a new Linux Hosting provider, but I am facing a problem is the .htacess file for the new hosting but the file works fine for the old hosting. I used the .htaccess file to redirect people's browsers to another URL the codes are as follow:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} ^zh-cn.*$ [NC,OR]
RewriteCond %{HTTP:Accept-Language} ^zh.*$ [NC]
RewriteRule ^.*$ http://www.google.com [R=302,L]

How can I make it work for my new Linux hosting?
 

Red Squirrel

No Lifer
May 24, 2003
70,155
13,566
126
www.anyf.ca
Do you get any errors when you try to start Apache? Maybe mod_rewrite is not installed.

Also there are lot of changes to Apache that are recent...ish. I moved from CentOS 6.6 to latest version of Devuan and there are lot of things that are different now with Apache, such as how the config file is structured, and some of the syntax. For example how allow/deny works. So there may be some changes to mod_rewrite too.