WordPress.org

Ready to get started?Download WordPress

Forums

can't acces login page on subfolder install (20 posts)

  1. photocoen
    Member
    Posted 1 year ago #

    Recently I started to have redirect issues on our subfolder hosted site.

    http://www.landcruisingadventure.com

    So I used this boilerplate on the .htacces file in the subfolder:

    # BEGIN WordPress
    # END WordPress
    
    RewriteEngine On RewriteBase /
    RewriteRule ^index\.php$ - [L] # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    And I have this .htacces file in the root:

    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName landcruisingadventure.com
    AuthUserFile /var/www/vhosts/landcruisingadventure.com/httpdocs/_vti_pvt/service.pwd
    AuthGroupFile /var/www/vhosts/landcruisingadventure.com/httpdocs/_vti_pvt/service.grp
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # added security by coen
    
    #Protect wp-config.php
    <Files wp-config.php>
    order allow,deny
    deny from all
    </Files>
    
    # directory browsing
    Options All -Indexes
    
    # Protect .htaccess
    <Files ~ "^.*\.([Hh][Tt][Aa])">
    order allow,deny
    deny from all
    satisfy all
    </Files>

    From there everything on went smooth. Until I needed to sign in again, and I can't acces my login page.

    http://www.landcruisingadventure.com/wp-login.php

    It sends my to:

    http://www.landcruisingadventure.com/wplca/wp-login.php

    but instead of showing the login page, it shows file not found?

    When I try to go to:

    http://www.landcruisingadventure.com/wp-admin

    it sends me to:

    http://www.landcruisingadventure.com/wplca/wp-login.php?redirect_to=http%3A%2F%2Fwww.landcruisingadventure.com%2Fwplca%2Fwp-admin%2F&reauth=1

    How do I get to my login page?

    Adventurous greetings,
    Coen

  2. So I used this boilerplate on the .htacces file in the subfolder:

    What subfolder? They're supposed to be virtual...

  3. photocoen
    Member
    Posted 1 year ago #

    I installed WP in a subfolder on my server. And put a .htacces file in the root and in the subfolder.

  4. EITHER the multisite is installed in http://www.landcruisingadventure.com or it's installed in http://www.landcruisingadventure.com/wplca

    It's not both. Which one is it?

    (Note: I do not mean where is your SUB site, I mean where is the root Multisite installed?)

  5. photocoen
    Member
    Posted 1 year ago #

    Your right, the site is installed in http://www.landcruisingadventure.com/wplca

  6. So WP is installed in http://www.landcruisingadventure.com/wplca but you set it up to run out of http://www.landcruisingadventure.com/ (i.e. giving WP it's own directory)

    Your .htaccess is wrong.

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L] # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] 
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    And even then, RewriteBase / may need to be RewriteBase /wplca/

  7. photocoen
    Member
    Posted 1 year ago #

    Great!

    You saved me a lot of headaches!

    Adventurous greetings,
    Coen

  8. photocoen
    Member
    Posted 1 year ago #

    hmmmm maybe I shouted to early... I can log-in now. But all the posts are not accesible by the public.

    I am getting a:

    Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

    So I am back to square one.......

    I have this as the .htacces in the subfolder:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /wplca/
    RewriteRule ^index\.php$ - [L] 
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] 
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    How do I get rid of the redirect error?

  9. Looks like landcruisingadventure.com/wplca is being redirected to http://www.landcruisingadventure.com/wplca

    Which do you have in wp-config.php?

  10. photocoen
    Member
    Posted 1 year ago #

    I don't have that set in the wp-config.php file.

    But under the general settings I have this:

    WordPress Address (URL): http://www.landcruisingadventure.com/wplca
    Site Address (URL): http://www.landcruisingadventure.com

    Or do you mean something else?

  11. photocoen
    Member
    Posted 1 year ago #

    If I update the permalink structure at the Permalink Settings tab of the settings, it shows the posts allright, but I know from previous times this is only a matter of time it's going to show the redirect errors again....

  12. I mean something else. Look in your wp-config.php for something like this:

    define( 'DOMAIN_CURRENT_SITE', 'YOURDOMAIN.COM' );

    What is yours? :)

    But if updating the permalinks works then the odds are you have a plugin that's breaking it :/ Something's resetting permalinks in a bad way.

  13. photocoen
    Member
    Posted 1 year ago #

    I don't have anything that resembles

    define( 'DOMAIN_CURRENT_SITE', ........

    in my wp-config.php . Should there be that?

    updating the permalinks works only temporary.... if a plugin is causing that, how would I check that?

  14. What DO you have in wp-config.php for your Multisite defines?

  15. photocoen
    Member
    Posted 1 year ago #

    Nothing I guess. This is my wp-config.php

    <?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', 'xxxxxx');
    
    /** MySQL database username */
    define('DB_USER', 'xxxxxx');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'xxxxxx');
    
    /** 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', '');
    
    /**#@+
     * 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.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         'xxxxxx');
    define('SECURE_AUTH_KEY',  'xxxxxx');
    define('LOGGED_IN_KEY',    'xxxxxx');
    define('NONCE_KEY',        'xxxxxx);
    define('AUTH_SALT',        'xxxxxx');
    define('SECURE_AUTH_SALT', 'xxxxxx');
    define('LOGGED_IN_SALT',   'xxxxxx');
    define('NONCE_SALT',       'xxxxxx');
    
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress. A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
     * language support.
     */
    define('WPLANG', '');
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', false);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  16. Well... Okay. That wp-config.php doesn't have Multisite AT ALL.

    You either are looking at the wrong one, or you never actually set up Multisite. I kind of think this goes back to our difficult sorting out WHERE WP was installed, though.

    Re-read: http://codex.wordpress.org/Create_A_Network#Step_4:_Enabling_the_Network

    See how there are two steps and #1 is to edit the wp-config?

    Without those lines, it'll never work.

  17. photocoen
    Member
    Posted 1 year ago #

    This is the right one.

    I never wanted a multi site install. I started out with a local hosted site and developed it, because we are 24/7 on the road for the last 10 years. So internet is not so evident for us.

    Then I installed the site in a folder on the server. I want it to sit in folder for various reasons.

    Everything went well until a few weeks ago [the site has been up for more than 4 months or so] it started to give redirect errors...

    So you think I should add a network? I just want it to be served from the folder....

  18. Okay.. wait a second.

    If you're not using Multisite, and don't want it, why are you posting in the Multisite SubForum?

    I think you're just in the wrong place, cause this subforum is just for people who use Multisite, not for people who have multiple separate installs.

  19. photocoen
    Member
    Posted 1 year ago #

    I wasn't aware that this was especially for multisites and I just wanted a solution for my permalink error keep appearing.

    As I do have my site hosted inside a folder on my server, where would I likely to find a solution?

    Adventurous greetings,
    Coen

  20. Well for starters, stop using the multisite htaccess for your non-multisite site! :D

    And since this is SUCH a mess, you should make a new post in http://wordpress.org/support/forum/how-to-and-troubleshooting or http://wordpress.org/support/forum/installation on how to get the second, separate, install running.

Topic Closed

This topic has been closed to new replies.

About this Topic