HUB: Add Website Sync - issue/resolution found

this is more of a general note to you folks. i installed a new wordpress install, via cPanel wordpress manager, into a subfolder install. next, i went to the hub to "add website" and it wouldn't add. i thought it was funny, because i had just seen an email coming through from someone who couldn't get their site to sync... so i played around with it a little bit.

i found that it wasn't until there was an .htaccess file present that the hub's add website feature worked. everything worked totally fine after i added that.

so, just a note to let you guys know about that...

  • Predrag Dubajic

    Hi splaquet,

    Thanks for the information, let me just double check that I understand this properly so I could make sure that I'm testing the right thing here :slight_smile:

    So, you have installed WP normally, as a single installation, but there's no .htaccess file for it.
    Then you changed into subfolder multisite, but still didn't add .htaccess file and the rules that are provided by WP when you activate multisite.
    At this moment you were unable to connect your site to Hub, but then you created .htaccess file with subfolder rules in it and after that you were able to connect.

    Was that the case or am I missing something?

    Best regards,
    Predrag

  • splaquet

    it was a regular WP install.

    - i went to cPanel and used their widget to create a new WP setup (campbiscocolorwar.com/content)
    - i went to wpmu websites to add site
    - when i entered in my login credentials and the URL above, i couldn't get it to connect (i tried a few times)
    - i went back into WP and set permalinks (quickest way i know to create an .htaccess file)
    - i went back to hub -> add site... and it worked right away

  • Adam Czajczyk

    Hi @splaquet!

    I just tried it on two different servers:

    1) My own with no cPanel

    - I have manually installed fresh single WP
    - I removed .htaccess file from it
    - then I headed on to "The Hub -> Add Website -> Sync" and put an URL and my admin credentials there

    That worked fine.

    2) Another host with cPanel

    - I set a fresh regular WP install using cPanel WordPress Installer; I put it in a subfolder of the domain (over https://)

    - the .htaccess was actually created there, so I removed it anyway

    - then again I tried to sync it with The Hub and that also worked fine.

    So, in case of two different servers (different host, different server configuration, very different geographic location etc), site was connected to The Hub even without .htaccess.

    I'm wondering therefore if the .htaccess itself is a problem here. Did you actually check if the .htaccess was indeed missing after the installation was created? Also, did you use a standard WordPress Installer of cPanel or maybe some sort of additional "suite' (like Installatron or similar)?

    I'm also wondering whether your host might have somehow customized the installer. Are you able to replicate that problem or it happened just once and then you didn't try again? If so, could you try to replicate to see if it happens again?

    Let me know, please.

    Kind regards,
    Adam

  • Predrag Dubajic

    Hi splaquet,

    I tried testing this on my server but I'm also unable to replicate it as well.
    Can you tell me how your folder structure looks.
    #1
    main site in /public_html/
    blog in /public_html/blog/
    dev in /public_html/control/

    #2
    main site in /public_html/
    blog in /public_html/blog/
    dev in /public_html/blog/control/

    #3
    no installation in /public_html/
    blog in /public_html/blog/
    dev in /public_html/control

    #4
    no installation in /public_html/
    blog in /public_html/blog/
    dev in /public_html/blog/control/

    Can you tell me which of the above setups is true in your case?

    Best regards,
    Predrag

  • splaquet

    #3
    no installation in /public_html/
    blog in /public_html/blog/
    dev in /public_html/control/

    there's an .htaccess and index.php (that points to /blog/index.php) in /public_html

    i apologize if i'm just spinning your wheels here. i'm realizing that this might have been a hiccup or something unrelated. i was trying to help the cause, but the last thing that i want to do is waste your time. *I'm* able to set things up just fine... i was thinking that this might be related to, and to help out someone else's issue (the 'royal' someone)

  • splaquet

    so, 2 things I've found:
    1) i believe that i've found that iThemes Security is putting a stop to auto-sync attempts
    2) it looks like my client really muffed up their .htaccess file. I consider myself someone who knows enough to be dangerous... but I don't know what these guys were thinking. I *know* they knew that WordPress was installed and that's what they were using... so this .htaccess file came as a surprise to me

    ##
    # @package    Joomla
    # @copyright  Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
    # <a title=@license href=/profile/license>The Nerdery</a>    GNU General Public License version 2 or later; see LICENSE.txt
    ##
    
    ##
    # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
    #
    # The line 'Options +FollowSymLinks' may cause problems with some server configurations.
    # It is required for the use of mod_rewrite, but it may have already been set by your
    # server administrator in a way that disallows changing it in this .htaccess file.
    # If using it causes your site to produce an error, comment it out (add # to the
    # beginning of the line), reload your site in your browser and test your sef urls. If
    # they work, then it has been set by your server administrator and you do not need to
    # set it here.
    ##
    
    ## No directory listings
    <IfModule autoindex>
      IndexIgnore *
    </IfModule>
    
    ## Can be commented out if causes errors, see notes above.
    Options +FollowSymlinks
    Options -Indexes
    
    ## Mod_rewrite in use.
    
    RewriteEngine On
    
    ## Begin - Rewrite rules to block out some common exploits.
    # If you experience problems on your site then comment out the operations listed
    # below by adding a # to the beginning of the line.
    # This attempts to block the most common type of exploit <code>attempts</code> on Joomla!
    #
    # Block any script trying to base64_encode data within the URL.
    RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
    # Block any script that includes a <script> tag in URL.
    RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
    # Block any script trying to set a PHP GLOBALS variable via URL.
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    # Block any script trying to modify a _REQUEST variable via URL.
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    # Return 403 Forbidden header and show the content of the root home page
    RewriteRule .* index.php [F]
    #
    ## End - Rewrite rules to block out some common exploits.
    
    ## Begin - Custom redirects
    #
    # If you need to redirect some pages, or set a canonical non-www to
    # www redirect (or vice versa), place that code here. Ensure those
    # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
    #
    ## End - Custom redirects
    
    ##
    # Uncomment the following line if your webserver's URL
    # is not directly related to physical file paths.
    # Update Your Joomla! Directory (just / for root).
    ##
    
    # RewriteBase /
    
    ## Begin - Joomla! core SEF Section.
    #
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    #
    # If the requested path and file is not /index.php and the request
    # has not already been internally rewritten to the index.php script
    RewriteCond %{REQUEST_URI} !^/index\.php
    # and the requested path and file doesn't directly match a physical file
    RewriteCond %{REQUEST_FILENAME} !-f
    # and the requested path and file doesn't directly match a physical folder
    RewriteCond %{REQUEST_FILENAME} !-d
    # internally rewrite the request to the index.php script
    RewriteRule .* index.php [L]
    #
    ## End - Joomla! core SEF Section.
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # This domain inherits the “PHP” package.
    # php -- END cPanel-generated handler, do not edit'

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.