Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe I found my issue -- it was with the RewriteRule that redirected to the old site.</p> <p>This is what I had when I posted the question:</p> <pre> <code> # redirect everything to archive.example.com except for a few directories RewriteCond %{REQUEST_URI} !^(/|/static|/blog|/about)$ RewriteRule ^/(.*)$ http://archive.example.com/$1 [NC,R=301,L] </code> </pre> <p>...and I rewrote this to:</p> <pre> <code> # redirect everything to archive.example.com except for a few directories RewriteCond %{REQUEST_URI} !^/$ RewriteCond %{REQUEST_URI} !^/static.*$ RewriteCond %{REQUEST_URI} !^/blog.*$ RewriteCond %{REQUEST_URI} !^/about.*$ RewriteRule ^(.*)$ http://archive.example.com%{REQUEST_URI} [NC,R=301,L] </code> </pre> <p>Here's why. </p> <p>First, as you can see, I broke up the single rewrite condition into four separate conditions because this will enable me to cleanly add more directories for exclusion as the new site grows. </p> <p>You will also notice that I added a dot-star after /static, /blog/ and /about so that it will match on any path in those directories and not just the top level.</p> <p>Finally, on the RewriteRule line I removed the leading slash from the pattern and changed the trailing /$1 to %{REQUEST_URI} . I don't need to store any variables from the pattern here -- I just need to change the server name -- so instead of extracting the path from the pattern, I made it more explicit by using the same %{REQUEST_URI} variable that was used on the previous four lines. </p> <p>BTW: One of the reasons this was causing confusion for me at first was because Chrome was sometimes caching the DNS/path info -- doing a Ctrl-F5 to purge the cache will enable you to see your changes. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload