Sami Ullah
Sami Ullah

Reputation: 129

how to rewrite SEO friendly url in htaccess

How to create an SEO friendly URL like example.com/pages/my-first-page/followers here I want how to create a structure in if(isset($_GET['followers'])){...} and htaccess file.

My link working fine till example.com/pages/my-first-page/ but now I want to add followers section. I hope i explain well what I expecting. Thanks for your help

Upvotes: 0

Views: 68

Answers (1)

anubhava
anubhava

Reputation: 786081

Rule you've suggested is this:

RewriteRule ^pages/([\w-]+)/followers/?$ page.php?pages=$1&followers=1 [QSA,NC,L]

This is pretty good rule and there is no reason why it should not work. Make sure this rule is placed before page rule which is your first rule in .htaccess

Upvotes: 1

Related Questions