Support » Fixing WordPress » After changing Site Address to domain root, 404 served for old wp site url

  • Resolved csanyk

    (@csanyk)


    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 http://mydomain.com/wordpress and I now have the Site Address moved to http://mydomain.com/ — now that it’s set up and working, if I try to browse to http://mydomain.com/wordpress I get a 404 error.

    I’d like to set up my .htaccess file to permanently redirect http://mydomain.com/wordpress/ to http://mydomain.com. How do I do that? Note that because the wp-admin urls are still at http://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`

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘After changing Site Address to domain root, 404 served for old wp site url’ is closed to new replies.