mrj Posted October 1, 2017 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
Bailey Posted October 1, 2017 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!
mrj Posted October 2, 2017 Author Posted October 2, 2017 Thanks for Your reply. I will try your suggestions.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now