• bpiltz

    (@bpiltz)


    Hi there,

    I wanted to have my old WP site accessible again. It still has some content I would like to reach. Luckily I can reach the backend still but also would like to have the page running again in a subfolder also by having the subfolder in the URL. It was a installation in the root directory and as I brought my new page online it was not accessible anymore (only the backend). Although I already moved everything it still get’s redirected to my new page which is residing in a subdirectory also and redirected to from the root index.php.

    So here is what I did:
    – I changed the URLs in the settings of the admin-backend
    – I moved everything related to WP to that subdirectory
    – I double checked the database and all URL-related entries
    – I double checked the code for hard coded URLs
    – I checked requires in the the index.php in the subfolder which seem to be fine.
    – I double checked then language plugin which is also involved into URL building
    – I also checked the .access files which also have the wordpress passage in there including the subfolder in the root as well as in the subdirectory.

    What works:
    – I can access wp-admin in the subdirectory and edit things
    – I can call the infophp.php within the subfolder

    what does not work:
    – Any Wp page also previews are always redirected to my new page. That makes me think that for some reason the root directory is still called and not directly the subfolder. But I can not find the reason for this now.

    Any ideas well appreciated!

    Here is the content of the root .access:

    php_value memory_limit 256M
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase //
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . //index.php [L]
    </IfModule>
    Options Indexes FollowSymLinks Includes ExecCGI MultiViews

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

    # END WordPress

    That all looks good for me.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Do you want to give WordPress its own directory?

    If so, try reviewing this Article:

    Giving WordPress Its Own Directory

    Joy

    (@joyously)

    Remove the section for //.
    Also, go to the Settings > Permalinks page and Save, so a new .htaccess is written in the folder.
    Also, you might need a Search/Replace plugin to fix any URLs you have in content.

    Thread Starter bpiltz

    (@bpiltz)

    @t-p thanks but I do not want to power the website’s root the URL needs to have the subdir, too.

    @joy I tried to remove that complete section:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase //
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . //index.php [L]
    </IfModule>
    But then nothing was loading anymore (some kind of server error). Thus I did not re-save as you described but it threatened me as the wordpress is not the main thing anymore and had to have the prio on the new site running in the first place where this seems to be related to.

    I ended up now using some forking in the index.php in the root:

    <?php

    $requri = $_SERVER[‘REQUEST_URI’];
    if(strpos($requri, ‘wordpress’) !== false){ //if the URI contains the wordpress subdir
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );
    }else{ // go to the new page as usual
    // Weiterleitungsziel inkl. 301 Status
    header(“Location:https://event.sensavo.com/index.php&#8221;, true, 301);
    exit;
    }
    ?>

    This works well when starting from the backend and calling some pages (previes) what is all I currently wanted.

    But thanks I may try to run the search/replace plugin as all the images in the articles are broken currently.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t move installation from root to subfolder’ is closed to new replies.