• Resolved webexpadmin

    (@webexpadmin)


    Greetings,

    I have a setup where I’m using a single domain and have created 2 folders at the site root. For example –

    mydomain.com/test1
    mydomain.com/test2

    Each has its own wordpress installation. My reason for doing this is that I’m testing a modified plugin against its original version.

    In each installation (‘test1’ and ‘test2’) a page and a post were created.

    The problem occurs when I’ve opened ‘test2’ to view the site and I then click the link to view a page or post. Instead of going to ‘test2’ I end up at ‘test1’. The page is “Not Found” and the theme links change from ‘test2’ to ‘test1’. Also the link in the ‘test2’ view points to a location in ‘test2’.

    I’ve taken a closer look at test1/wp-content/cache/supercache and test2/wp-content/cache.

    And in ‘test1’ I find the folders and files that actually belong in ‘test2’, and ‘test2’ is empty.

    Maybe there’s a better way for me to do this test, if there is please let me know. However, please keep in mind that I need to test both versions of the plugin using a single domain.

    Thanks!

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

    (@leejosepho)

    mydomain.com/test1
    mydomain.com/test2

    Are those using the same database or does the second site have its own that had been properly updated so it can find its own stuff?

    Thread Starter webexpadmin

    (@webexpadmin)

    Good question!

    How is the answer determined?

    leejosepho

    (@leejosepho)

    I’m using a single domain and have created 2 folders at the site root.

    What method did you use for doing that? I do not want to sound presumptuous here, but there is more to “moving (duplicating) WordPress” than copying its folders and files. For a second site, you would also copy its database to a second location or set of tables for the second site. So if your second wp-config.php file does not show a unique table_prefix, then you might have both sites running from the same set of database tables that could only send out the links that set or tables should send.

    Thread Starter webexpadmin

    (@webexpadmin)

    The folders were created prior to installing wordpress using the cpanel file manager. Using cpanel, wordpress was installed twice. First into ‘test1’, and then a second time under ‘test2’.

    I’ve taken a look at both wp-config.php files and $table_prefix is identical. So I’ll try changing those to something unique in each config file and see what happens. I’ll reply here with the results.

    Thread Starter webexpadmin

    (@webexpadmin)

    Thanks for your help!

    Changing $table_prefix in wp-config.php for ‘test2’ only did the trick. After the modification the subsequent admin login goes through some installation steps, I kinda expected that. But I’ve done some testing by creating a page and a post and can see that the initial problem no longer occurs.

    Since that change to $table_prefix did the trick I’m wondering why it isn’t made unique when wordpress gets installed. WordPress makes the MySQL settings unique. So why not $table_prefix? Are there any advantages to leaving it set to ‘wp_’? If so, under what circumstances?

    Thanks again!

    leejosepho

    (@leejosepho)

    Changing $table_prefix in wp-config.php for ‘test2’ only did the trick.

    Yes, and so what you now have is a server database (see its name in either wp-config file) holding two sets of tables (you have a unique table_prefix in each wp-config file) and both sites are using the same MySQL user and password to access its set of tables (WordPress “database”). That is working and it is no big deal, but it is also like having one chef serving food to two different dining rooms while having to work in two different kitchens in order to do that. So, go to MySQL databases in Cpanel and make a new MySQL user for site #2, then assign that user to your server database with full permissions, then put that user’s username and password in the wp-config file for site #2 so it can have a chef of its own.

    note: Be cautious with anything like a plugin capable of changing a site’s table_prefix because you now have to sets of tables visible within one database and accessible by any MySQL user having access to that database.

    Since that change to $table_prefix did the trick I’m wondering why it isn’t made unique when wordpress gets installed. WordPress makes the MySQL settings unique.

    I had never thought about that, but that makes sense — see above — since having a default MySQL user and password at thousands of sites would be a huge security risk.

    So why not $table_prefix?

    Obscurity only offers the *illusion* of security.

    Are there any advantages to leaving it set to ‘wp_’?

    Not that I know about, but I have only been around for a little over two years.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘one domain, 2 wordpress installations and pages/posts are confused’ is closed to new replies.