WordPress.org

Forums

Permalinks not working (9 posts)

  1. dgraydesign
    Member
    Posted 5 years ago #

    I'm working on a blog that was installed using GoDaddy's one-click install on a site into a "blog" directory. There was no .htaccess generated (yes, I can see hidden files). I tried adding one in blog directory and then setting the permalink structure, but I get the message in the dashboard that my .htaccess file can't be modified. It's looking in the root, not the WP directory. When I tried simply adding the WordPress rules to the root level .htaccess, it worked, but whenever an incorrect url is typed in for the site at the root level it no longer returns the custom error page, but instead goes to the blog home page. This is the code that I added:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
  2. esmi
    Forum Moderator
    Posted 5 years ago #

    What site url are you using for your blog?

  3. dgraydesign
    Member
    Posted 5 years ago #

    It's at http://domainname.com/blog. I removed the rewrite rules from the root level htaccess since it was causing the error page problem, so you can't actually see the behavior on the site right now. I'd prefer not to share the client's site info here, but if I need to, let me know.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    You could now try and add the WP rewrite rules to an .htaccess file in the blog folder. I've got a couple of WP installs running in sub-folders with non-WP sites in the root folder. I've not come across a problem before and certainly not one where WP tried to add something to the root .htaccess file. In each case, it's the installation folder's .htaccess file that's been re-written.

  5. dgraydesign
    Member
    Posted 5 years ago #

    I'll try that - thanks!

  6. dgraydesign
    Member
    Posted 5 years ago #

    Success! Thanks for the help!

  7. esmi
    Forum Moderator
    Posted 5 years ago #

    Did you manage to figure out why WP was initially writing to the root .htaccess file?

  8. dgraydesign
    Member
    Posted 5 years ago #

    I think that was my misunderstanding. I assumed that it was looking in the root because of the recommended rewrite rules, but that wasn't the case.

  9. esmi
    Forum Moderator
    Posted 5 years ago #

    OK. Glad to heat you got it sorted anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags