WordPress.org

Support

Support » How-To and Troubleshooting » can't access pages without trailing / – can't access /wp-admin

can't access pages without trailing / – can't access /wp-admin

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]

    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.

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

    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?

    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/

    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.

    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.

    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

    Reply To: Weblog in utf-8, rss-feed in iso-8859-15?

    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

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

    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

    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

    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/

    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.
Skip to toolbar