• Resolved intellivision

    (@intellivision)


    WP’s .htaccess rules are handling requests for product_reviews.php (a non-WP page), and I want WP to leave that page alone.

    The WP rules are fine, work great. When I remove WP rules, Product Reviews rules work fine.

    But together, the product_reviews page doesn’t work because WP handles it and displays its 404 page when it doesn’t find product_reviews in /blog.

    I’ve tried a bunch of things like moving one over another, redeclaring RewriteEngine on etc… even tried putting product_reviews.php in /blog. No dice.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # BEGIN WordPress
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    # END WordPress
    # BEGIN product_reviews
    RewriteBase /
    Rewritecond product_reviews/%{QUERY_STRING} submission=true
    RewriteRule product_reviews/mode/([0-9]+)/id/([0-9]+)(/)?$ product_reviews.php?mode=$1&id=$2&flag=2 [L]
    RewriteRule product_reviews/mode/([0-9]+)/id/([0-9]+)(/)?$ product_reviews.php?mode=$1&id=$2&flag=1
    # END product_reviews
    </IfModule>

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

    (@otto42)

    www.remarpro.com Admin

    Change it to this:

    RewriteEngine On
    RewriteBase /
    RewriteCond product_reviews/%{QUERY_STRING} submission=true
    RewriteRule product_reviews/mode/([0-9]+)/id/([0-9]+)(/)?$ product_reviews.php?mode=$1&id=$2&flag=2 [L]
    RewriteRule product_reviews/mode/([0-9]+)/id/([0-9]+)(/)?$ product_reviews.php?mode=$1&id=$2&flag=1 [L]
    # END product_reviews
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress

    And then don’t ever change anything inside the # WordPress tags anymore. You can change your rules all you like, as long as they come BEFORE the WordPress rules. Also, any RewriteRule you use should have the [L] tag at the end.

    Thread Starter intellivision

    (@intellivision)

    Thanks Otto!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to allow an .htaccess exception for a regular page?’ is closed to new replies.