How to create URL structure for SEO friendly using htaccess ?

This post shows how to create a redirect from a link to another link with query string or create SEO friendly URL structure.

If you want to get this link /index.php?name=Rupam page open as user/query_string_name/quesry_string_value then you should follow steps
1. Create a page with a .htaccess  extension on your root.
2. Then you have to put the code to enable the rewrite engine.

# Turn rewrite engine on
Options +FollowSymlinks
RewriteEngine on

3. Next, write the rewrite rule for redirecting.

#Rewrite for index.php
RewriteRule ^user/name/([0-9a-zA-Z]+) index.php?name=$1 [QSA,L]
#NC makes the rule non case sensitive
#L makes this the last rule that this specfic condition will match
Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *