By AdamUsering
So on our site, we have dynamic pages which will fetch info on what is requested. For the sake of making sense, I’ll use our blog as an example.
So I have website.com/blog/article?id=4, which will fetch a certain article from the data base. After looking around for this answer, I couldn’t figure anything out. I want the url to look like website.com/blog/article/4. Using the help of Google, I came up with this:
Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase /blog RewriteRule ^([^/]+)/([^/]+)$ article.php?id=$1
Since both blog and article are actual pages, I couldn’t have arguments for what page I want specifically. Any help on how to achieve this will be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
What you are looking for is called SEO friendly urls. I found few articles that should help you. :)
http://stackoverflow.com/questions/26285463/creating-seo-friendly-urls-using-htaccess http://webrewrite.com/url-rewriting-htaccess/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.