WordPress.org

Ready to get started?Download WordPress

Forums

WordPress .htaccess cause 500 error on 404 outside of WP (2 posts)

  1. Brooke Dukes
    Member
    Posted 3 years ago #

    Hi,

    I'm not sure if I've found a bug or am just doing something wrong. It seems that using WordPress permalinks is causing a problem on any url outside of the WordPress directory.

    For example, I have WP at example.net and a subdomain at sub.example.net well if I use the default .htacess everything works fine inside of WordPress but seems to cause a loop during a 404 search outside of WordPress.

    I think the problem is that the line RewriteRule ^index\.php$ - [L] is trying to find index.php in the subdomain folder and is failing so it's getting grumpy and throwing a 500 error. If I comment out this line the 404 error works but (obviously) not WordPress permalinks.

    Not sure if there is an easy fix and I'm just missing something here.
    Here is the complete .htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
  2. Brooke Dukes
    Member
    Posted 3 years ago #

    Looks like one solution is to just turn off RewriteEngine for the subdomain

    <IfModule mod_rewrite.c>
    RewriteEngine off
    </IfModule>

    I'm hoping there may be a better solution though. :)

Topic Closed

This topic has been closed to new replies.

About this Topic