WordPress.org

Forums

Redirect Not Working After Giving WordPress Its Own Directory (7 posts)

  1. vagabondjourney
    Member
    Posted 2 years ago #

    Hello,

    I followed the instructions on http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install as to how to use a preexisting subdirectory install of WordPress that will display the pages in the root. It all worked fine except for the fact that the old homepage and the categories will not redirect to the proper page.

    The former homepage of my blog was at

    http://www.vagabondjourney.com/travelogue/

    And it is suppose to redirect to http://www.vagabondjourney.com, but doesn't.

    I tried putting a standard 301 redirect (Redirect 301 /travelogue/ http://www.vagabondjourney.com) for this into the htaccess file, and, while it did redirect the page properly, when I tried to log into my admin panel (which is in the directory -- /travelogue/wp-admin) I received a DNS error.

    Does anyone know how to fix this?

    Also, the categories will not redirect either.

    Thanks.

  2. govpatel
    Member
    Posted 2 years ago #

    Are the countries in bottom menu your categories if so they are working fine when I click on them

  3. vagabondjourney
    Member
    Posted 2 years ago #

    If you type in the former address of the categories into your browser (which have the /travelogue/ directory in the url) it won't redirect. WordPress has taken care of the "in-system" links. The ones I want to redirect are all the links to category pages that I've inserted manually into the pages myself over the past 7 years.

    Also, my main worry is why the old homepage is not redirecting, as it has tons of links pointing at it.

  4. vagabondjourney
    Member
    Posted 2 years ago #

    # 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

    This is the code that WordPress automatically put in the htaccess file when I reset my blog address. For some reason it's not redirecting the former blog homepage.

  5. vagabondjourney
    Member
    Posted 2 years ago #

    Sorry, the last post was from the htaccess that was put in my root. The code that was put in my htaccess file in my directory (/travelogue/) is:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /travelogue/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /travelogue/index.php [L]
    </IfModule>

    # END WordPress

  6. johnqbuck
    Member
    Posted 2 years ago #

    I just did a WP install that had this exact same problem.

    I followed these instructions:

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    to give WordPress it's own directory and ended up with a weird redirect at login.

    Turns out I had to remove the directory from the .htaccess file I had in the directory itself, so that the root .htaccess and the directory .htaccess were identical.

    # 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
  7. artifex404
    Member
    Posted 1 year ago #

    I had the same issue! Followed the same official instructions, and my site stopped working.

    Found the solution in a blog. http://upcode.tk/site-not-working-after-moving-wordpress-own-directory/

Topic Closed

This topic has been closed to new replies.

About this Topic