hi there guys,
I'm building a system much like a blog install and using Wordpress as inspiration, I've endeavoured to turn a title into part of the URL. To clarify, when I create a Wordpress article, it takes the subject and converts it into a friendly URL, which is what I'd like my system to do:
Current:
URL: domain.com/?article=1
Title: I'd Like To Teach The World To Sing
My dream
URL: domain.com/article/id_like_to_teach_the_world_to_sing
I looked at the Wrodpress htaccess file and although I thought I'd find an entry for each article with a redirect, I only found the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Which confuses me. The only two ways I can imagine Wordpress would know which URL to use is either if it were retrieving the URL info from the database in real time or if it was referencing another text file, but I don't see either happening. I guess I don't have to tell anyone that I don't understand regex. I'm at a distinct disadvantage because I can't actually decipher the code above.
I've set up my script to store a permalink entry in the database for each article, so each one has the portion that I'm hoping to use as the URL in the place of the article's ID. How do I get my server to retrieve that database info and use mod rewrite to get the visitor to the article in question?