1

we have wordpress main site on domain.com now we did copy of the site and put in the sub-folder domain.com/blog we did all necessary url changes. but it seems we have issues with .htaccess file.. the domain.com/blog is redirected to domain.com

this is what .htaccess in root

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

this is what .htaccess in /blog folder

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

whats wrong with them? thanks a lot

migrated from superuser.com Mar 27 at 8:51

This question came from our site for computer enthusiasts and power users.

1

Your .htaccess looks just fine, but you need to tell WordPress itself that it got moved. Simply put the following line into your wp-config.php, then access your site's login page under the new URL and login. After that you can remove this line.:

define('RELOCATE', TRUE);

Alternatively add the following two lines to your wp-config.php, then navigate through the site a few pages far, then you can remove these lines.

define('WP_HOME', 'http://domain.com/blog');
define('WP_SITEURL', 'http://domain.com/blog');

Source: Changing The Site URL.

-1

You need to Re-Check following two:

  1. SITEURL and Home in database table wp_options
  2. settings in wp-config.php

    To learn more about check WordPress documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy