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

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

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

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$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]

How can I fix redirect?

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


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.org/Changing_The_Site_URL

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.