• 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 “https://northcoastimports.com/wp-login.php/” , after I put in the login info it redirects me to “https://northcoastimports.com/wp-login.php” without the backslash and then I get a “broken-link” error from the browser.

    Also, “https://northcoastimports.com/wp-admin/” gives me a “broken-link” message, and so does “https://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:
    https://www.ads-software.com/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!

Viewing 15 replies - 1 through 15 (of 21 total)
  • 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]
    Thread Starter northcoastimports

    (@northcoastimports)

    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:

    https://sternreiter.com/wp-admin

    Thanks for the help.

    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.

    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 https://blog.germanclocks.org/

    Thread Starter northcoastimports

    (@northcoastimports)

    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 https://northcoastimports.com/wp-admin or https://northcoastimports.com/wp-admin/

    Did I do something wrong?

    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    ^(.+[^/])$           https://northcoastimports.com/$1/  [R=301,L]

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

    Thread Starter northcoastimports

    (@northcoastimports)

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

    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+[^/])$ https://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)

    https://sternreiter.com/wp-admin

    This one is the standard theme without pretty filenames.

    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.

    Thread Starter northcoastimports

    (@northcoastimports)

    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

    https://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.

    https://northcoastimports.com/wp-admin

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

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

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

    Thread Starter northcoastimports

    (@northcoastimports)

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

    Something else interesting: if I go to the subdirectory that has all the pics, I can just enter “https://northcoastimports.com/pics&#8221; (no trailing /) and I get there just fine.

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

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

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

    https://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

    Thread Starter northcoastimports

    (@northcoastimports)

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

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

    Thread Starter northcoastimports

    (@northcoastimports)

    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/

    Thread Starter northcoastimports

    (@northcoastimports)

    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?

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘can't access pages without trailing / – can't access /wp-admin’ is closed to new replies.