I've recently added a pagination system to my tag listings that limits database results to a threshold of N records on a page. For example:
tag-search/index.php?tag=mytag&page=1
Using mod_rewrite rules, I've given each tag listing page a friendly URL, where the page number is optional (if omitted, page=1 is assumed)...
example.com/tag/mytag
example.com/tag/mytag/1
My problem is trying to find a mod_rewrite rule that will work with my current rules to drop /1 from any URL since it is unnecessary, and for SEO purposes.
My current rules are as follows:
- Code: Select all
RewriteRule tag/(.+)\/(.+) tag-search/index.php?tag=$1&page=$2 [NC,L]
RewriteRule tag/(.+) tag-search/index.php?tag=$1 [NC,L]
Thank you!