WordPress.org

Ready to get started?Download WordPress

Forums

can't access pages without trailing / - can't access /wp-admin (22 posts)

  1. northcoastimports
    Member
    Posted 3 years ago #

    I can't access any pages without putting a trailing "/" and I never had to do that before... so that means that none of my links in the site work because they don't have that trailing "/"

    It also means that I can't login to the admin because, even if I manually go to "http://northcoastimports.com/wp-login.php/" , after I put in the login info it redirects me to "http://northcoastimports.com/wp-login.php" without the backslash and then I get a "broken-link" error from the browser.

    Also, "http://northcoastimports.com/wp-admin/" gives me a "broken-link" message, and so does "http://northcoastimports.com/wp-admin"

    I haven't had this problem before in over a year of using this website. I have two other installations of WP, and all three use the Atahualpa Theme - all with the same problem. I also have an installation of WP with WordPress Default 1.6 that works okay.

    I have another thread that talks about the problem and what I've done so far:
    http://wordpress.org/support/topic/cant-login-cant-access-login-page?replies=8#post-1861867

    There they said the problem was probably in my .htaccess file which is copied here:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    RewriteCond %{HTTP_HOST} ^northcoastimports.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.northcoastimports.com$
    RewriteRule ^press\.htm$ "http\:\/\/blog\.germanclocks\.org" [R=301,L]

    What can I do? Any help is greatly appreciated!

  2. mattytemple
    Member
    Posted 3 years ago #

    After a quick look in the Apache FAQ I would guess that this is a problem with the configuration.

    If you have access to the config files you can make the changes describe here or contact your host and see if they will do it for you.

    You can also make the server add the trailing slash for you via the .htaccess file with the following code

    RewriteEngine  on
    RewriteBase    /~quux/
    RewriteRule    ^foo$  foo/  [R]
  3. northcoastimports
    Member
    Posted 3 years ago #

    If I use that code in my .htaccess file do I replace the code that I already have there, or add it?

    I'm not sure it's a server problem, because it works fine with another WP installation on the same server:

    http://sternreiter.com/wp-admin

    Thanks for the help.

  4. mattytemple
    Member
    Posted 3 years ago #

    Because it works on the other install I'm lost as to why, for now.

    That code should still work around your problem on the sites it doesn't work on and yes add it to whats already there.

  5. mattytemple
    Member
    Posted 3 years ago #

    OK after looking at your site again the problem might with the press.htm redirect in the .htaccess.

    While the code looks fine it's the only page that loads without a trailing slash you might want to try removing or commenting out that last line.

    If that last line is the problem try this in it's place
    Redirect 301 /press.htm http://blog.germanclocks.org/

  6. northcoastimports
    Member
    Posted 3 years ago #

    Thanks for your help - but still no dice.

    I tried this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    RewriteEngine on
    RewriteBase /~quux/
    RewriteRule ^foo$ foo/ [R]

    # END WordPress

    RewriteCond %{HTTP_HOST} ^northcoastimports.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.northcoastimports.com$
    # RewriteRule ^press\.htm$ "http\:\/\/blog\.germanclocks\.org" [R=301,L]

    Still don't have access to anything without a trailing /

    Also, still don't have access to http://northcoastimports.com/wp-admin or http://northcoastimports.com/wp-admin/

    Did I do something wrong?

  7. mattytemple
    Member
    Posted 3 years ago #

    OK you can uncomment the last line and remove the extra section.

    Then add the following at the very top of the file.

    RewriteEngine  on
    RewriteBase    /
    RewriteCond    %{REQUEST_FILENAME}  -d
    RewriteRule    ^(.+[^/])$           http://northcoastimports.com/$1/  [R=301,L]

    source: http://planetozh.com/blog/2004/05/apache-and-the-trailing-slash-problem/

  8. northcoastimports
    Member
    Posted 3 years ago #

    Thanks again, but I still get the same results. Here's my .htaccess file now:

    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+[^/])$ http://northcoastimports.com/$1/ [R=301,L]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    RewriteCond %{HTTP_HOST} ^northcoastimports.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.northcoastimports.com$
    RewriteRule ^press\.htm$ "http\:\/\/blog\.germanclocks\.org" [R=301,L]

    Are we barking up the wrong tree? I can't help but think that the problem is in WP or in the Theme since this one works fine (different theme, same server)

    http://sternreiter.com/wp-admin

    This one is the standard theme without pretty filenames.

  9. mattytemple
    Member
    Posted 3 years ago #

    My first thought was the pretty URLs in WordPress but wp-login.php and /wp-admin and physical files and folders and shouldn't be affected by the pretty URLs settings.

    The default WP .htaccess code checks if a file/folder exists before rewriting the URL. If the file does exist it won't rewrite the URL.

    You may need to look at the Apache logs to see whats going on when the 404s are generated.

  10. northcoastimports
    Member
    Posted 3 years ago #

    Thanks. I just asked for help from my server. I also posted something on the Atahualpa Theme forum, since all of my installations with that theme seem to have the same problem - even the ones without pretty URL's

    http://forum.bytesforall.com/showthread.php?p=53403#post53403

    These are the three installations in question. All use Atahualpa Theme, not all of them have pretty URL's. They have different .htaccess files, and I've never had this problem before with any of them, even after using them for more than a year.

    http://northcoastimports.com/wp-admin

    http://northcoastimports.com/design/wp-admin

    http://northcoastimports.com/museum/wp-admin

  11. mattytemple
    Member
    Posted 3 years ago #

    Apart from the theme do do they all have something else in common? That could be the cause of the problem.

  12. northcoastimports
    Member
    Posted 3 years ago #

    Not that I'm aware of. Only that they use the same root directory of http://northcoastimports.com

    Something else interesting: if I go to the subdirectory that has all the pics, I can just enter "http://northcoastimports.com/pics" (no trailing /) and I get there just fine.

    Here's a comparison:
    http://sternreiter.com/wp-admin
    works correctly, standard WP theme, no pretty URL, .htaccess file is blank

    http://northcoastimports.com/wp-admin
    doesn't work, Atahualpa Theme, pretty URL, .htaccess file already posted

    http://northcoastimports.com/design/wp-admin
    doesn't work, Atahualpa Theme, no pretty URL, .htaccess file is blank

    http://northcoastimports.com/museum/wp-admin
    doesn't work, Atahualpa Theme, pretty URL, .htaccess file posted below:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /museum/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /museum/index.php [L]
    </IfModule>

    # END WordPress

  13. northcoastimports
    Member
    Posted 3 years ago #

    I don't think it's an Atahualpa Theme problem. I changed the theme to the default with the same results.

  14. mattytemple
    Member
    Posted 3 years ago #

    With nothing else in common between the sites I'm stumped as to the cause of the problem

  15. northcoastimports
    Member
    Posted 3 years ago #

    As far as I can tell, the only thing in common is that they share the same directory at the host:

    /nci/
    /nci/design/
    /nci/museum/

  16. northcoastimports
    Member
    Posted 3 years ago #

    I thought about moving the whole thing to another server, but can I restore the installation without logging in? Can I copy the files and then save and restore the db and it'll be there? Or, do an installation through fantastico, then copy the files, then restore the db through my sql? Will that work?

  17. mattytemple
    Member
    Posted 3 years ago #

  18. northcoastimports
    Member
    Posted 3 years ago #

    Looks like my server found a trojan. It works now.

    They told me that I'll have to "investigate my site scripts for any potential injections." which I have no idea how to do.

  19. northcoastimports
    Member
    Posted 3 years ago #

    There were two encoded PHP files that looked to be Trojan scripts, contained in the /wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/ directory.

    Any experience with that?

  20. mattytemple
    Member
    Posted 3 years ago #

    WP Security Scan will look for volubilities in WordPress but no I've never had to deal with a trojan on my servers

    http://wordpress.org/extend/plugins/wp-security-scan/

  21. manuelraigada
    Member
    Posted 3 years ago #

    I have two other wp installations with the exact same problem. They are on the same server, but with two different ftp users.

  22. northcoastimports
    Member
    Posted 3 years ago #

    - investigate your site scripts for any potential injections;
    - remove any suspicious files from your web space;
    - update your scripts to the latest available versions;
    - change the passwords to your sites as they may have been stolen.

    Look in the logs to see where files were changed before you noticed the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic