mrj Posted October 1, 2017 Share Posted October 1, 2017 Hello,I've created a quotes db where I can save my own quotes . To make my quote page seo friendly, I need to rewrite "quotes.php?id=1" as "quotes/view/1.html" and "quotes.php?p=2" as "quotes/pages/1.html".For 1st term I used following code in .htaccess:#Options +FollowSymLinksRewriteRule ^/quotes/([0-9]+).html$ /quotes.php?id=$1 [NC,L]But unfortunately, it.didn't work. So I need help. Thanks in Advance.Regards,Meraj Quote Link to comment Share on other sites More sharing options...
Bailey Posted October 1, 2017 Share Posted October 1, 2017 That re-writes to a file that doesnt exist thats why it doesnt work, you need to to go to quotes/view/1 not 1.html because its looks for the html file 1 in the directory /view/ RewriteRule ^blog/article/([A-Za-z0-9-\+]+)/?$ /index.php?Page=blogarticle&id=$1 [NC,L,QSA] [NC] Means no case[L] means last - dont check against other RewriteRules! ^quote/view/([A-Za-z0-9-\+]+)/?$ /index.php?Page=view&id=$1 $1 will pass the whatever comes after view/... or what is placed within ([A-Za-z0-9-\+]+) as a php variable id this means you can use php to load up the required page! For example, my website over at http://Bailey.cf uses only one index page but complex rewriterules to make it how it seems! Quote Link to comment Share on other sites More sharing options...
mrj Posted October 2, 2017 Author Share Posted October 2, 2017 Thanks for Your reply. I will try your suggestions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.