WordPress rewrite gallery url

I am writing a WordPress gallery with pagination and now have URL like:

http://example.lt/photo/value/?id=2

Read More

I want have:

http://example.lt/photo/value/id/2

where:

value - post name 
photo - static not change 

I tried permalink settings, but there was no result for my problem, and I think I need to rewrite roles htaccess(?).

Related posts

Leave a Reply

1 comment

  1. Add these above any wordpress rules you have in your document root:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^photo/([^/]+)/([^/]+)/([0-9]+)/?$ /photo/$1/?$2=$3 [L,QSA]