wordpress url rewrite Query Var to Static url

i have urls like these:


and have some url parameters


is there anyway to have urls like these:


I found my solution: here is my code:

    function mangareader_init() {
        'index.php?post_type=manga&name=$matches[1]&chp=$matches[2]', 'top');
      // Once you get working, remove this next line


Okay lets try this (didn’t want to put it “just as comment” because of the code.

In your comment you gave still no answer on a “possible caching issue” but still. Maybe, just maybe this part of code in .htaccess could help. Be aware this code could mess up more then wished! (Please read what is explained! follow that link for more information please).

This code before the line # BEGIN WordPress in .htaccess. Source code found here.

RewriteEngine On
RewriteCond %{QUERY_STRING} !=""         #if there is a query string
RewriteCond %{QUERY_STRING} !^p=.*       #wordpress users: allow post tempalinks
RewriteCond %{REQUEST_URI} !^/wp-admin.* #wordpress users: don't break admin
RewriteRule ^(.*)$ /$1? [R=301,L]        #remove query string

I also found some answers on Stackoverflow itself. Maybe there you also find some source code you could use/try. RewriteCond/RewriteRule for removing query strings from URLs

Another answer which maybe could help is found here: also stackoverflow

Source : Link , Question Author : user1489083 , Answer Author : Community

Leave a Comment