• Hello,
    in brief: my WordPress resolves permalinks-looking URLS even when it is not supposed to do it.

    I am using WordPress and I have set up a custom URL rewriting structure so that urls like

    website.com/b/cola

    are silently mapped in something like

    website.com/?action=list&brand=cola

    Then my custom wordpress plugin reads and manages the $_REQUEST values silently set and passed. This trick works in 95% of cases.

    The problem is, if there is a post beginning, say, with “cola”, WordPress strangely “catches up” the permalink instead of letting the already modrewritten URL to pass through.

    So what happens is that, if a post whose permailink “cola-is-delicious” exists, this will pop up eventhogh “cola” just maps the initial part of its permalink. Of course this is not good. If the match can be partial, any sorts of problems can pop up when the posts become many.

    my htaccess is as follows:

    <IfModule mod_rewrite.c>
    # This should match all URLS of the form b/brandname
    RewriteEngine On
    RewriteBase /
    RewriteRule ^b/(.+)/ ?action=list&brand=$1 [L,QSA]
    </IfModule>

    # 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

    Question #1: Is is possible to turn partial mapping off on permailinks in the wordpress core?

    Question #2: How is it possible that the second set of rules is applied before the first set does? I think that, if permalinks is ON, WordPress core is trying to resolve permalinks in any case, which leads to the next, very important,

    Queston #3: Is there any filter/function to temporarily turn permalink resolution off (I will use it in my plugin)

    Thanks to anybody capable of sheding some light on this issue,

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘htaccess and permalinks curse’ is closed to new replies.