Forums

Plugin authoring, help with .htaccess rewrites (1 post)

  1. Anonymous
    Unregistered
    Posted 3 years ago #

    I've recently started writing a WordPress plugin for a piece of existing software. I've been pretty successful except with the the rewrite rules.

    The software contains a number of rules similar to below:

    RewriteRule ^product/(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]

    During the course of making the plugin I've changed products.php to simply /products/ so my .htaccess in this case looks like:

    Options -MultiViews

    RewriteEngine On

    RewriteBase /

    RewriteRule ^product/(.*).html$ products/?q=$1&rewrite=1&%{QUERY_STRING} [L]

    (some other similar rules from the software)

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    </IfModule>

    # END WordPress

    I cannot for the life of me get this to work and everything I have tried results in a 404 error. Can anyone let me know where I'm going wrong?

    Thanks,
    Mike

Topic Closed

This topic has been closed to new replies.

About this Topic