Pass parameter to WordPress plugin with pretty url, mod_rewrite, .htaccess

I told WordPress that I wanted urls to look like:
domain.com/postname.html

I want to pass a parameter to a WordPress plugin. So when I get
domain.com/postname.html.2 it is supposed to be domain.com/postname.html?tubepress_page=2

Read More

With the following the parameter is passed correctly, but not the name.

This is the .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^.*([0-9]+)$ /?tubepress_page=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>

So for URL domain.com/postname.html.2
The above .htaccess basically works, it gives me the correct parameter to the script, but not the correct page, it gives me the latest WordPress post.

I think it somehow is missing the post name, but I don’t know how to
specify that in the RewriteRule.

I get the same if I type:
domain.com/.2
which gives me the latest post.

So what would be good
domain.com/xyz.html.2 to be tubepress_page=2 for the page xyz
and I don’t want to specify xyz.html anywhere in the htaccess file,
since I want to
try to avoid typing in things for each new post I make.

How do I specify it so that the post name variable is taken into consideration in the RewriteRule?

Any help on this would be very much appreciated.

Related posts

Leave a Reply

1 comment