1

I have a site http://test.site.com with /var/www/html configured as a DocumentRoot. Previous website needed APC cache to be enabled. I needed to migrate new website into the same folder. Steps were as follows:

  1. mv /var/www/html /var/www/html_old
  2. mkdir html
  3. copy new files to html directory (like it was previously)

Result: when opening URL http://test.site.com in a browser, browser redirects to non-existing domain http://www.test.site.com so I get page not found error there.

Apache access log with error 301:

[12/Jul/2016:15:24:24 +0300] "GET / HTTP/1.1" 301 321 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"

I have tested both with enabled and disabled APC cache - server still gives 301 redirect. No special directives set up to have this, and no .htaccess files are located in the directory. Any ideas how to avoid error 301 and make server understand that "nothing" has changed so it reads from /var/www/html again?

djtester
  • 63
  • 4
  • did you look for .htaccess/httpd.conf directives that would be enforcing a mandatory `www` in the http_host? – Marc B Jul 12 '16 at 14:25
  • Yes, there seems to be no such directives enabled/enforced... – djtester Jul 12 '16 at 14:30
  • apache checks for .htaccess files in not only the url's target dir, but all parent dirs as well. you need to check them all. – Marc B Jul 12 '16 at 14:33

0 Answers0