WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] setting up wordpress on a subdirectory (12 posts)

  1. siawacsh
    Member
    Posted 1 year ago #

    Hello, I have been struggling with implementing a security feature as per your link referred to from the WordPress dashboard settings. I am a novice and steep learning curve. So please bear with me.

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    I have installed WP on a subdirectory /hide

    But want the outside world to see my site as concentricdesigns.biz

    Another words, the regular users would just type concentricdesigns.biz to log on to my site. But my WordPress is hidden in subdirectory /hide.

    According to the wordpress tutorial, all I have to do is go my dashboard and set “site address” (URL) to concentricdesigns.biz and “WordPress Address” (URL) to concentricdesigns.biz/hide

    Then I edit the following line in index.php stored within /hide to

    require('./hide/wp-blog-header.php');

    I then copy this file over from /hide to the root directory on the server.

    I have done this. But I cannot view my site when I type concentricdesigns.biz. I keep getting

    Error establishing a database connection

    However, when I type in Concentricdesigns.biz/hide I get


    concentricdesigns

    Just another WordPress site

    This is somewhat embarrassing, isn’t it?
    It seems we can’t find what you’re looking for. Perhaps searching can help.

    I can also login to the back end of concentricdesigns.biz/hide/wp-admin which works fine.

    I also notice that when I download WP on to my local drive I get the following file structure in descending order.

    1. WordPress (which I created as the root prior to downloading using FileZilla)

    2. Folders on one level: /hide >>> WordPress >>> WP-admin >>> WP-content >>> WP-includes: and file index.php

    To reiterate, this is the structure I downloaded from the server unaltered. within the /hide folder there is another index.php file but with the default code:

    require('./wp-blog-header.php');

    I would like to know is the correct file structure. I would also like to know if for each different site I create I should create different folder on my local drive and copy WP into it. I expected FileZilla would create this according to the site name by default. But it does not do this.

    This is an important feature. Please let me know what step I am doing wrong to correct this.

    Regards
    Siavash Sefidvash

  2. Are you running WordPress on a Windows (IIS) server?

  3. siawacsh
    Member
    Posted 1 year ago #

    No, Bluehost uses Linux.

  4. Try adding this to your wp-config.php file:

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com/folder');
  5. siawacsh
    Member
    Posted 1 year ago #

    Hello Patrick,

    I tried your amendment as I understood it. I am including my config file for you to check.
    I am assuming that this file is to be placed in the subdirectory /hide.

    But unfortunately has not worked.

    I have edited out the lines where my password and database login are meant to go.

    Please amend and let me know.

    Many thanks in advance

    Siawacsh

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'concenu6_innercircle');
    
    /** MySQL database username */
    define('DB_USER', 'username');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'password');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    define('WP_HOME','http://concentricdesigns.biz');
    
    define('WP_SITEURL','http://concentricdesigns.biz/hide');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
  6. It seems to work just fine on my end. Please check again.

    http://concentricdesigns.biz/sample-page/

  7. siawacsh
    Member
    Posted 1 year ago #

    Yes indeed, it works now. Don't know how to thank you enough.

    All the best to you!

    Siawacsh

  8. Awesome, glad to help :-) Please go ahead and mark this topic as resolved.

  9. siawacsh
    Member
    Posted 1 year ago #

    Thank you!

  10. siawacsh
    Member
    Posted 1 year ago #

    Hi Patrick, I forgot to ask one thing. As you saw this website is empty at the moment. So there are no .htaccess file.

    From some of the WP documentation I read that if I am using fancy permalinks then the hidden .htaccess file must also be updated. But the documentation was not clear as to what should be done with it.

    I would like to know this for the future.

    Thanks.

    siawacsh

  11. Your fancy permalinks are working fine right now so don't worry about changing anything in your .htaccess file. In general, you shouldn't edit this file unless there's an issue or you have specific rules to add (and know what you are doing).

  12. siawacsh
    Member
    Posted 1 year ago #

    Thanks for the reply. But if that is the case I don't understand why .htaccess file was mentioned in the WP tutorial at all.

    I just figured all the ground work should be done now while my site is still empty, rather than do it after I have a fully functional site.

    Siawacsh

Topic Closed

This topic has been closed to new replies.

About this Topic