WordPress 404 without trailing slash

I know this has probably been answered as it seems a common question but I am having problems getting the solutions around working for me.

I have a wordpress site in a sub directory of another site. when i try and call http://site.com/blog i get redirected and a 404 error but when i call http://site.com/blog/ the page renders as expected.

Read More

The solution that keeps coming up seems to be

# and does not end with a slash
RewriteCond %{REQUEST_URI} !/$
# then add a trailing slash and redirect
RewriteRule (.*) $1/ [R=301,L]

but every time i request the page without the trailing slash i get redirected to http://site.com/app/webroot/blog

the subfolder the blog has been installed is within the webroot of a cakephp app which i think might have something to do with it?

Related posts

Leave a Reply

2 comments

  1. Try adding the following to the top of your .htaccess file, right under RewriteEngine On. I assume the .htaccess file is in the root directory of your site.

    #if this already exists, skip it, otherwise it should be before any other Rules
    RewriteEngine on
    #add this line to prevent your directory structure from showing up
    RewriteBase /