title: Infinite redirect loop in my website, but why?
body: <p>I get 404 in link checkers for some of my pages, which I can open in browser normally, and I also get an infinite loop warning in Google webmaster tools when I check those pages, and I can’t find the source of the problem!</p>
  
  <p>Here’s the whole story: I had two websites, w1 and w2. After a while, I decided to move the content of w2 to a subdirectory in w1. So, now I have a CMS in the root of W1, and another CMS in the subdirectory (the first CMS is TextPattern and the second one is OpenCart). I’ve redirected the old w2 website to that particular sub directory in w1. </p>
  
  <p>The htaccess in old w2 contains:</p>
  
  <pre><code>Redirect 301 / w2/subdirectory?oldlink=
  </code></pre>
  
  <p>(the ?oldlink= might seem stupid, but I didn’t know how better to do that!)</p>
  
  <p>The htaccess in the root of w1:</p>
  
  <pre><code>DirectoryIndex index.php index.html
  
  Options +FollowSymLinks
  Options -Indexes
  ErrorDocument 403 default
  
  &lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
  
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^(.+) - [PT,L]
  
      RewriteCond %{REQUEST_URI} !=/favicon.ico
      RewriteRule ^(.*) index.php
  
      RewriteCond %{HTTP:Authorization}  !^$
      RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
  &lt;/IfModule&gt;
  
  #php_value register_globals 0
  
  # SVG
  AddType image/svg+xml  svg svgz
  AddEncoding gzip       svgz
  </code></pre>
  
  <p>And lastly, the htaccess in the subfolder (inside w1, for the content of the old w2):</p>
  
  <pre><code>Options +FollowSymlinks
  
  # Prevent Directoy listing 
  Options -Indexes
  
  # Prevent Direct Access to files
  &lt;FilesMatch "\.(tpl|ini|log)"&gt;
   Order deny,allow
   Deny from all
  &lt;/FilesMatch&gt;
  
  # SEO URL Settings
  RewriteEngine On
  
  RewriteBase /subdirectory/
  RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  </code></pre>
  
  <p>I don’t have any redirecting tags in my web pages. 
  Everything works fine in the subdirectory; I can open pages, navigate through them, etc. </p>
  
  <p>When I check w1 in online link checkers, I get 404 for the pages in the subdirectory. When I check it with Fetch as Google, it gives me “The page seems to redirect to itself. This may result in an infinite redirect loop. Please check the Help Center article about redirects.” Warning, and the following details are:</p>
  
  <pre><code>HTTP/1.1 301 Moved Permanently
  Date: Sun, 27 Oct 2013 16:42:24 GMT
  Server: LiteSpeed
  Connection: Keep-Alive
  Keep-Alive: timeout=5, max=100
  Location: the sub directory
  X-Powered-By: PleskLin
  Content-Type: text/html
  Content-Length: 413
  
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt; 301 Moved Permanently
  &lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;&lt;h1&gt; 301 Moved Permanently
  &lt;/h1&gt;
  The document has been permanently moved to &lt;A HREF="%s"&gt;here&lt;/A&gt;.&lt;hr /&gt;
  Powered By &lt;a href='http://www.litespeedtech.com'&gt;LiteSpeed Web Server&lt;/a&gt;&lt;br /&gt;
  &lt;font face="Verdana, Arial, Helvetica" size=-1&gt;LiteSpeed Technologies is not responsible for administration and contents of this web site!&lt;/font&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>So, I’m really confused. I can’t find the source of the infinite redirect. Can anyone help me with this?
  Thanks.</p>