• fel64

    (@fel64)


    I’ve extended WP by making a custom gallery system as a page template, which uses lightbox and supports linking to (by passing parameters through the URL). I want to rewrite the URL so that it is pretty, basically, but it seems that WP interferes.

    I basically want to turn
    from ?page_id=ID&imgcat=XXX&imgname=YYY
    to /pagename/XXX/YYY

    Clearly there’s no way to turn the page_id into the page-name, so I’m happy to have a seperate rewrite rule for each such page.

    My problem is that if you have anything other than a number after /pagename/ WP returns a 404. How do I get around this?

    This is the contents of my .htaccess file, which is in my root directory:

    Options +FollowSymlinks
    Options -Indexes
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^fable-2-gallery/([^.]+)/([^.]+)$ index.php?page_id=14&imgcat=$1&imgname=$2 [L]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Help making this work would be much appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘mod_rewrite with WP’ is closed to new replies.