• pr0nto

    (@pr0nto)


    I’m the webmaster of http://www.badasshotties.com (NSFW) and am having occasional problems with my website. Every so often, an .htaccess file appears in my main folder and it throws everything off. I’m unable to access badasshotties.com/stats for example, along with my /categories, and many more and instead get a 404 error. When I delete the .htaccess file, everything suddenly works normally.

    Any idea why this is happening or how I can stop my htaccess file from constantly reappearing every few days? Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    The .htaccess file is what allows your permalinks to work. Notice how the links to individual posts on your blog give you 404 errors? That’s because you keep deleting the .htaccess file.

    You shouldn’t delete things without knowing what they do.

    Thread Starter pr0nto

    (@pr0nto)

    Touche. That’s what was causing the /categories part not loading. Still, there’s the issues with trying to load /stats every so often. I think it also affects /feed. This is noticeable every week or so and only gets fixed when I delete the htaccess (which, as you pointed out, screws over more important parts of my page)

    Thread Starter pr0nto

    (@pr0nto)

    The /stats are unaccessible again (404). Any idea why this might be occurring?

    Thread Starter pr0nto

    (@pr0nto)

    I’m still having /stats issues as well as /feed. If I rename/delete the .htaccess file, stats is accessible. Is there any way I can fix this issue, or something I can put into the .htaccess to allow access to those features?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    What is the content of the .htaccess file?

    Thread Starter pr0nto

    (@pr0nto)

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

    # END WordPress

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Change it to this:

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

    Afterwards, set the permissions of the file to 444, so WordPress won’t modify it.

    You won’t be able to make a page beginning with “stats” in WordPress though.

    Now the /feed, on the other hand, WordPress handles. You shouldn’t need to change anything for it.

    Thread Starter pr0nto

    (@pr0nto)

    Awesome! That didn’t work, but I did use that to help me Google for something. It led to a help file by my webhost that expanded on that code a bit more and works perfectly. Thanks for the 444 reminder though, I would have totally forgotten.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘htaccess overwritten?’ is closed to new replies.