title: WordPress Redirection not working after Moving to Subdirectory
body: <p>Today I moved my wordpress website from Root Directory to Subdirectory in same domain. I moved all files to new subdirectory. I have also setup 301 wildcard redirection from Hosting cpanel</p>
  
  <p><strong>301 Wildcard redirection Setting -</strong></p>
  
  <p>Old Address - <code>https://www.example.com</code></p>
  
  <p>New Address - <code>https://www.example.com/blog/</code></p>
  
  <p>When I am visiting any post directly like <code>https://www.example.com/blog/this-is-a-post</code> then it showing correct post without any error but the problem when I am opening the same post without "blog" word i.e. <code>https://www.example.com/this-is-a-post</code>  then it also showing correct post instead of redirecting it to <code>https://www.example.com/blog/this-is-a-post</code>.</p>
  
  <p>And when I visit through Google then it visiting the old address only i.e. without the word "blog".</p>
  
  <p>One more thing is occuring is redirecting <code>https://www.example.com</code> to <code>https://www.example.com/blog</code> which is also what I don't want because I have different html index file for homepage</p>
  
  <p><strong>URL Settings in Wordpress Dashboard -</strong></p>
  
  <p>WordPress Address (URL) - <code>https://www.example.com/blog</code></p>
  
  <p>Site Address (URL)      - <code>https://www.example.com/blog</code></p>
  
  <p><strong>Contents of <code>.htaccess</code> file:</strong> </p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /blog/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /blog/index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>