I’m trying to modify my website URL for better SEO. Here’s what i have so far:
RewriteRule ^page-([0-9]+)/?$ /index.php?p=$1 [L,QSA,NC]
i want http://www.domain.com/page-10
instead of http://www.domain.com/index.php?p=10
but how do i also match http://www.domain.com/category/index.php?p=2
and rewrite it to http://www.domain.com/category/page-2
2
Answers
You can another rule for
/category/
:You even combine both rules into one with this regex.
Change
http://www.domain.com/category/index.php?p=2
tohttp://www.domain.com/category/index.php?p=page-2
and re-write your htaccess to match: