I have a website and trying to rewrite it’s url. The pages are as:
www.mydomain.com/newv2/pvgs.php?archive=april/2014
www.mydomain.com/newv2/pvgs.php?archive=april/2014&page=1
I have using pagination but I want when any one click on for archive months then he will get only 1 URL as http://www.mydomain.com/newv2/april/2014
And when he click on pagination the page nuber added at last means 2nd url as http://www.mydomain.com/newv2/april/2014/1
.
Place this in /newv2/.htaccess
:
RewriteEngine On
RewriteBase /newv2/
RewriteRule ^([a-z]+/[0-9]+)/?$ pvgs.php?archive=$1 [L,QSA]
RewriteRule ^([a-z]+/[0-9]+)/([0-9]+)/?$ pvgs.php?archive=$1&page=$2 [L,QSA]