WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] After changing Site Address to domain root, 404 served for old wp site url (4 posts)

  1. csanyk
    Member
    Posted 6 months ago #

    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`

  2. csanyk
    Member
    Posted 6 months ago #

    bump.

  3. ubaidullahbutt
    Member
    Posted 6 months ago #

  4. csanyk
    Member
    Posted 6 months ago #

    Thank you! The redirection plugin worked for me.

Reply

You must log in to post.

About this Topic