After changing Site Address to domain root, 404 served for old wp site url
-
I have an existing wp installation in a subdirectory on my domain, and recently decided to change the Site Address in my WP General Settings to the domain root. After following the directions I was able to get it to work, but with one small problem. If I try to browse to the old url that used to serve the main wp site, I get a 404 error.
In other words, my wp site used to be at https://mydomain.com/wordpress and I now have the Site Address moved to https://mydomain.com/ — now that it’s set up and working, if I try to browse to https://mydomain.com/wordpress I get a 404 error.
I’d like to set up my .htaccess file to permanently redirect https://mydomain.com/wordpress/ to https://mydomain.com. How do I do that? Note that because the wp-admin urls are still at https://mydomain.com/wordpress/wp-admin, I need to be sure that I’m not redirecting if I need to go to the wp-admin pages.
My .htaccess currently is as follows:
`<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># 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`
- The topic ‘After changing Site Address to domain root, 404 served for old wp site url’ is closed to new replies.