• Hi,

    I created the following page with the permalink :
    [ redundant link removed ]
    The page display a list of vehicles and each vehicle has his own link to the detailpage, like /gebrauchte/?vID=17681

    I managed to generate links for all vehicles in the following format :
    /gebrauchte/17681/gebrauchtfahrzeug-naked-bike-bmw-r-nine-t-asc-heizgriffe-led-blinker-1-hand

    I added the following lines at the top of .htaccess :

    RewriteEngine On
    RewriteBase /
    RewriteRule ^gebrauchte/(.*)/(.*) https://www.haensle.de/gebrauchte/?vID=$1 [NC,L]

    But this acts more as an Redirect. If I delete the domain from destination and use only this rule :
    RewriteRule ^gebrauchte/(.*)/(.*) /gebrauchte/?vID=$1 [NC,L]
    I receive “page not found”.

    The “gebrauchte” page has the ID 52170. By trying the following :
    RewriteRule ^gebrauchte/(.*)/(.*) index.php?page_id=52170&vID=$1 [NC,L]
    The list-page opened and not the detail-page, because the querylink parameter "vID=17681" is missing.

    Hope, someone can help ??

    • This topic was modified 4 years, 5 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Sorry for the late reply. Is your goal to have an URL like /gebrauchte/17681/gebrauchtfahrzeug-naked-bike-bmw-r-nine-t-asc-heizgriffe-led-blinker-1-hand return the single item’s page without needing a 302 redirect? You can have WP rewrite requests internally by using the Rewrite API. Then you can remove the related .htaccess rule.

    The page links to how to flush rewrite rules on plugin activation. You can instead manually flush rules by visiting the permalinks settings page. Just loading the page is enough, no need to change or save anything.

Viewing 1 replies (of 1 total)
  • The topic ‘RewriteRule Permalink and QueryString’ is closed to new replies.