最新消息: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)

multisite - How install wordpress in another wordpress folder?

matteradmin9PV0评论

I have a wordpress site(example) and I want to run another wordpress on the server. example's files are at /var/www/html/example directory on the server. I created a anotherSite Folder in /var/www/html/example/anotherSite and then copy all wordpress files in it. When I run , It connect to anotherSite but then redirect to .

/var/www/html/example/.htaccess are as follow:

########## REDIRECT SSL
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

####### REDIRECT WWW
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\$ [NC]
RewriteRule ^(.*)$ /$1 [R=301,L]

RedirectMatch 301 /MYFolder(.*) /MYFolder/$1


# 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>

How can I fix redirect?

Note: example have a post with id 23023 and title anothersite-how-can-we-have.

I have a wordpress site(example) and I want to run another wordpress on the server. example's files are at /var/www/html/example directory on the server. I created a anotherSite Folder in /var/www/html/example/anotherSite and then copy all wordpress files in it. When I run http://example/anotherSite, It connect to anotherSite but then redirect to http://example/anothersite-how-can-we-have/23023.

/var/www/html/example/.htaccess are as follow:

########## REDIRECT SSL
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

####### REDIRECT WWW
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\$ [NC]
RewriteRule ^(.*)$ https://www.example/$1 [R=301,L]

RedirectMatch 301 /MYFolder(.*) /MYFolder/$1


# 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>

How can I fix redirect?

Note: example have a post with id 23023 and title anothersite-how-can-we-have.

Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Dec 8, 2018 at 19:16 Morteza MalvandiMorteza Malvandi 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

I am not sure, but If you change folder of wordpress installation and when URL visited it still shows old URL, but you want it to show new URL. You should change address in wordpress settings.

Instructions: https://codex.wordpress/Changing_The_Site_URL

Post a comment

comment list (0)

  1. No comments so far