Reputation: 39
I'm not sure how to re-write a dynamic url into another kind of dynamic url?
I'm looking to change:
/blog/category.php?catseourl=ExampleCat&pn=1
/blog/category.php?catseourl=ExampleCat&pn=2
/blog/category.php?catseourl=ExampleCatTwo&pn=1
Into:
/blog/category/ExampleCat/1
/blog/category/ExampleCat/2
/blog/category/ExampleCatTwo/1
I've got to this point:
RewriteRule ^blog/category/([^/]*)$ /blog/category.php?catseourl=$1&pn=$1 [L]
But I'm not sure how to add the dynamic changes into the left hand side of the rewrite?
Thanks for any help.
Upvotes: 0
Views: 52
Reputation: 923
Try this:
RewriteRule ^blog/category/(.+)/([0-9]+)$ /blog/category.php?catseourl=$1&pn=$2 [L]
Upvotes: 0
Reputation: 4725
RewriteEngine On
RewriteRule ^blog/category/([^/]*)/([^/]*)/?$ /blog/category.php?catseourl=$1&pn=$2 [L]
Upvotes: 0
Reputation: 143876
Try
RewriteRule ^blog/category/([^/]+)/([0-9]+)/?$ /blog/category.php?catseourl=$1&pn=$2 [L]
Upvotes: 1