最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

installation - Wordpress in subfolder dont work

matteradmin8PV0评论

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

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

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

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

Share Improve this question edited Mar 28, 2019 at 10:30 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Mar 27, 2019 at 8:43 AdamoAdamo 2
  • 1 WordPress have this well documented: codex.wordpress/Giving_WordPress_Its_Own_Directory – Kinnectus Commented Mar 27, 2019 at 9:16
  • Maybe you left the old .htaccess in the root dir? Or some too cramped SSL RewriteRule? Or you site's Apache conf? – norman.lol Commented Mar 27, 2019 at 17:29
Add a comment  | 

2 Answers 2

Reset to default 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/blog');
define('WP_SITEURL', 'http://domain/blog');

Source: Changing The Site URL.

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

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far