Question

I am trying to use the following apache configuration on a Godaddy shared hosting account:

<Files ~ ".*">
<IfModule mod_headers.c>
RequestHeader unset Host
RequestHeader append Host mydomain.com
</IfModule>
</Files>

The above is contained in a .htaccess file. In other words... For all files and paths set the request's host to mydomain.com

The above doesn't seem to work. I get a 500 error on Godaddy's servers.

Thanks muchly!

Was it helpful?

Solution

The answer to this question was provided by Gumbo in the comments above

I rather think that your pattern is incorrect. If using mod_rewrite in a .htaccess file, the path prefix is being removed before applied to the pattern. Thereby “/foo/bar” is converted to “foo/bar” (if the .htaccess file is in the root “/”). So remove the leading slash from the pattern. – Gumbo Feb 23 at 14:29

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top