I have an existing site that I am now trying to secure, but I'm running into problems with the header and footer on the pages that are accessed via custom links in the menu. When I try to access a custom link (such as http://mywebsite.com/SomeNonWordPressComponent), the content loads, but the header and footer render as:

Moved Permanently

The document has moved here (https://localhost/common/header.php).

The header and footer on regular WordPress pages render perfectly fine.

What do I have to change so that the header and footer will render correctly for custom pages?

Things I've tried so far:

  • set WP_HOME and WP_SITEURL to begin with https.
  • click the "Save Changes" button on the Permalinks page.
  • manually add to my WordPress root directory's .htaccess this extra rewrite rule:
     RewriteCond     %{HTTPS} off
     RewriteRule     (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Still getting the redirect (as above) for the header and footer.

Also: the path common/header.php actually exists up one level from the wordpress root directory. Tried a symlink in wordpress to /path/to/webroot/common bt that does not seem to work, either.

1 Answer 1


Go to your WordPress dashboard and navigate to Settings >> General, then change the WordPress Address (URL) and the Site Address (URL) from HTTP to HTTPS. Then hit Save Changes button.

If your problem is not fixed yet then go to Settings >> Permalinks and hit Save Changes button again. It'll re-generate your .htaccess file. Sometimes the .htaccess cause some unusual problems. I'm just making sure that its fine.

  • I tried changing the URLs to use HTTPS yesterday but it had no impact. I'll try the Settings >> Permalinks change later today, if I have time. Oct 18, 2016 at 16:50
  • Well, I tried the "Save Changes" button but that did not work. Oct 18, 2016 at 20:47

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.