Title: RewriteRule Permalink and QueryString
Last modified: June 5, 2020

---

# RewriteRule Permalink and QueryString

 *  [torte74](https://wordpress.org/support/users/torte74/)
 * (@torte74)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/rewriterule-permalink-and-querystring/)
 * 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 5 years, 12 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frewriterule-permalink-and-querystring%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/rewriterule-permalink-and-querystring/#post-12981367)
 * 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](https://codex.wordpress.org/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.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [querystring](https://wordpress.org/support/topic-tag/querystring/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/rewriterule-permalink-and-querystring/#post-12981367)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
