WordPress.org

Ready to get started?Download WordPress

Forums

Deleting post redirects to root folder but WP site is not at root (8 posts)

  1. Cameron
    Member
    Posted 1 year ago #

    I have this structure at http://gaycurl.ca :

    /index.html (landing page for visitors to pick a city)
    /home.php (home page for the active Toronto site)
    /toronto/ (my WP site, not yet launched)

    The WP site under /toronto/ used to be hosted under /wordpress/, but I moved it. The site seems to be working fine, but one consistent problem appears every time I delete a post: after clicking Trash to delete, it redirects my browser to the root of the domain instead of remaining inside the WP site.

    This means when I'm on this page:
    http://www.gaycurl.ca/toronto/wp-admin/edit.php

    ...and I click Trash on a post, I end up on this page:
    http://www.gaycurl.ca/?trashed=1&ids=269

    This also happens when I restore a page from Trash. I end up here:
    http://www.gaycurl.ca/?untrashed=1

    In each case, I should have stayed inside /toronto/.

    I don't believe any source files have been edited, but since I upgraded 3.5 onto a version someone else installed I can't be sure. I don't know if this existed before the upgrade, as upgrading was my first step, followed by moving to new directory.

    No redirect plugins, just akismet, WP to twitter, Use Google Libraries, and Embed Latest Tweets.

    Important and possibly tricky note: index.html must remain the default root homepage, so that visitors can choose their city and only go into /toronto/ by choice.

  2. linux4me2
    Member
    Posted 1 year ago #

    On the admin side in Settings -> General, what do you have set for WordPress Address and Site Address? Both should be:
    http://www.gaycurl.ca/toronto
    If they aren't, that's the problem, if they are, you'll have to dig deeper.

  3. Cameron
    Member
    Posted 1 year ago #

    Thanks for the reply. Yes, the URLs match on that page. Any thoughts on what else I can check?

  4. linux4me2
    Member
    Posted 1 year ago #

    I would look next for an .htaccess in the /toronto folder that might have a redirect in it that's fouling things up for you.

    If that's not it, I would then look for an .htaccess in the root of your domain to make sure there's no issue there.

    If neither of those are at fault, I would check your wp-config.php (but don't post it here without removing your database info!) to see if along the line someone overrode the WordPress Address and Site Address in it.

  5. Cameron
    Member
    Posted 1 year ago #

    Thank you again for the suggestions. There is no .htaccess in either the root or under the toronto directory.

    In the wp-config, these lines exist and they strike me as suspicious. Would you suggest editing these to add "toronto" on that final slash?

    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
  6. linux4me2
    Member
    Posted 1 year ago #

    I don't think that's it because what PHP is saying is to use the directory that the wp-config is in (dirname(__FILE__) with a forward slash on the end) for the site URL if one is not set, and as long as your wp-config is in /toronto, so you should be okay. I don't think that's it.

    When you said you didn't find an .htaccess, did you have "show hidden files" or whatever enabled in your file manager or FTP client? That "." before the file means it's a hidden file, and sometimes those are not shown by default.

  7. Cameron
    Member
    Posted 1 year ago #

    Thanks for the quick reply.

    When I created an .htaccess file while troubleshooting this problem a few days ago, it was visible when uploaded to both the root and the toronto subdirectory. I deleted those, but it tells me my FTP software (FileZilla) is not hiding it from me.

    Thanks for the clarification of the meaning of that wp-config line as well! Too bad that's not it, but at least that's one more item that is not of concern.

  8. linux4me2
    Member
    Posted 1 year ago #

    It seems like you've done everything right, but we must be missing something.

Topic Closed

This topic has been closed to new replies.

About this Topic