Apache friendly urls

Posted by HaukurHaf on Stack Overflow See other posts from Stack Overflow or by HaukurHaf
Published on 2010-05-04T23:06:36Z Indexed on 2010/05/04 23:28 UTC
Read the original article Hit count: 190

Filed under:
|
|

Hi everyone.

I've got a small CMS system written in PHP and running on Apache. The format of the URLs this CMS system uses/generates is:

/display.php?PageID=xxx where xxx is just some integer number. As you can see, those URLs are not very friendly, neither for users nor search engines.

I believe that using mod_rewrite (or something like that) and .htaccess files I should be able to configure Apache for URL-rewriting. I have searched for information about this before but I did not find any easy method to do this, it always involved messing with regular expressions, which I'm not very familiar with.

Since the website in question is really simple and small, just 5-10 different pages, I would really like to be able to just hard-code the configuration, without any special rules or regexps.

I'd just like to map a friendly URL to an actual URL, perhaps like this:

/about = /display.php?PageID=44
/products = /display.php?PageID=34

etc.

Is it possible to configure the mod_rewrite plugin in a basic way like this?

Could someone explain the easiest method to do this? Explain it to me as if I was a child :-)

Thanks in advance!

© Stack Overflow or respective owner

Related posts about apache

Related posts about url-rewriting