1

I wrote this htaccess rule to fulfil my custom requirement that when there is certain host comes to the my main folder, use its resources from the other folder.

But the issue I am facing is, such rule works on all hosts including my local xampp, but not on hostgator. Is there anything I can do to support the hostgator?

RewriteCond %{HTTP_HOST} ^abc.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.abc.com$
RewriteCond %{REQUEST_URI} !abc/
RewriteRule (.*) /my/customfolder/abcfolder/$1 [L]

Output I am getting on server is 500 Internal Server Error

I have tried making [NC,OR] to [NC] but no success. Any solutions or alternatives?

3
  • Do you have mod_rewrite enabled on hostgator? Nov 11, 2015 at 15:18
  • Every other rule works fine except this one
    – Harry
    Nov 11, 2015 at 15:22
  • What do your Apache error logs say? You might want to check that. it's better than guessing at the problem. Nov 11, 2015 at 15:25

1 Answer 1

0

This probably occurs because the Apache mod_rewrite module is not loaded on your Hostgator server.

To test that, you can use plain

RewriteEngine on

in your .htaccess file. If you still get a 500, you can either modify your httpd.conf file and uncomment/add the line below:

LoadModule rewrite_module modules/mod_rewrite.so

Or probably submit a ticket to Hostgator to help you out if you're using a shared hosting.

You can check this thread for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.