• Resolved zer0blok

    (@zer0blok)


    A fresh install of WordPress in a sub-directory. Enabled Pretty Permalinks. -All checked and works.

    Immediately after enabling Permalinks, i changed the SiteUrl in General Settings for my Site to http://domain.com . -This also works in the front-end.

    *However, i can no longer preview Posts; either a new Post, or changes i’m making to an already published Post.*

    The message in the preview-window that is opened says: “Sorry, you are not allowed to preview drafts”, on an otherwise empty screen.

    I’m pretty sure now that i’ve done the installation correctly; that the .htaccess has been updated during Permalink and URL changes, then copied over to root directory; along with index.php, which has been appropriately edited.

      *index.php in root-directory* looks like this:

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . ‘/sub-directory/wp-blog-header.php’ );

      .htaccess in root-looks like this:

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

    # END WordPressdirectory

      .htaccess in the install (root) directory looks like this:

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

    # END WordPress

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

    (@t-p)

    – Access phpMyAdmin on your host, then check the wp_options Table (Note: The table prefix of wp_ may be different if you changed it when installing), and make sure siteurl field and home field are correct. See https://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    Backup: If you haven’t already done, always backup everything (including your database) before doing any actions, just in case something really goes wrong. You can never have enough backups!

    Thread Starter zer0blok

    (@zer0blok)

    Oops, made a mistake: just to be clear, the .htaccess in the install directory (second one listed): is not the root, but http://www.domain.com/web/sub-diretory.

    Also, my root directory is http://www.domain.com/web …this is the root, yes?

    Thread Starter zer0blok

    (@zer0blok)

    @t-p

    I can’t find a db in phpMyAdmin -WP was installed through an app on my hosting server, and the hosting shows no db’s used, only the WordPress app.

    Is there another method of accessing /changing these tables?

    *Also, i’ve noticed since first posting that no Preview facility works in WP Admin: i get “Non-existent changeset UUID” error in the Site-Preview in Appearance> Customise, for example.

    Moderator t-p

    (@t-p)

    see this codex for more methods: https://codex.wordpress.org/Changing_The_Site_URL

    Thread Starter zer0blok

    (@zer0blok)

    I couldn’t get this work -there could be any number of reasons. Anyway, i decided to drop the network for the time being, as it’s not necessary to progress with the Site.

    Instead, the Site is now set-up as a single site, with only the ‘www’ prefix removed from WordPress and Site URLs in General >Settings; and Pretty Permalinks enabled with a custom structure.

    Wordpress and Jetpack now work, no problems, and do the things that i need done; i can move onto designing the Site, which is all i want to do. So, issue resolved -not through code, in this case, but changing functional strategy.

    Moderator t-p

    (@t-p)

    Glad to know it 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Preview Posts doesn’t work after SIteURL change’ is closed to new replies.