简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM