Prettifying URLs

Sorry if this is considered off-topic, but I was fiddling around with PHP and web servers after a long absence, and I wanted to make URLs look nicer, like:

http://site.com/index.php?page=status
// to
http://site.com/status
http://site.com/content.php?request=profile&uid=100
// to
http://site.com/profiles/100

I know this forum is for Java gaming, but I figured that someone on here could help me get the [icode].htaccess[/icode] squared away. (Also, this is just for learning purposes, in case someone is wondering)

CopyableCougar4

since you’re using php, i’m assuming you’re using apache or nginx, so look up url rewriting.

you only really have to do this with php, more modern web frameworks allow you to directly define a route like

/profile/:id

and it maps it to a controller. check out play framework, its power lies in scala but java is ok.

I’m using an apache server with PHP installed. I know I want to use [icode]mod_rewrite[/icode] and rewrite the URLs with the [icode].htaccess[/icode] file. I would like to further my PHP knowledge, hence I am trying to accomplish this web server project in PHP.

I guess my question is what lines I need in my [icode].htaccess[/icode] to accomplish this. I have tried googling this, and have found many answers all over from tutorialspoint to stack overflow. However, all of them return a [icode]500 Internal Server Error[/icode].

Sorry if this is offtopic.

Any snippets would be helpful,
CopyableCougar4